22 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
23 |
#include <config.h> |
#include <config.h> |
24 |
#endif |
#endif |
|
|
|
|
#include <windows.h> |
|
25 |
#include <time.h> |
#include <time.h> |
26 |
|
#include <windows.h> |
27 |
|
|
28 |
#include "gpgme.h" |
#include "gpgme.h" |
29 |
#include "wptCommonCtl.h" |
#include "wptCommonCtl.h" |
33 |
#include "wptW32API.h" |
#include "wptW32API.h" |
34 |
#include "wptGPG.h" |
#include "wptGPG.h" |
35 |
#include "wptErrors.h" |
#include "wptErrors.h" |
36 |
|
#include "wptUTF8.h" |
37 |
|
|
38 |
|
|
39 |
/* Parse the colon status information of @line and store |
/* Parse the colon status information of @line and store |
92 |
{ |
{ |
93 |
gpg_uid_info_t i, t; |
gpg_uid_info_t i, t; |
94 |
char *p, *pend; |
char *p, *pend; |
95 |
|
char *name; |
96 |
int field = 0, len = 0; |
int field = 0, len = 0; |
97 |
|
|
98 |
if (!line || strlen (line) < 3 || strncmp (line, "uid", 3)) |
if (!line || strlen (line) < 3 || strncmp (line, "uid", 3)) |
123 |
break; |
break; |
124 |
|
|
125 |
case 10: /* user ID */ |
case 10: /* user ID */ |
126 |
i->name = (char *)calloc (1, strlen (pend)+1); |
name = (char *)calloc (1, strlen (pend)+1); |
127 |
if (!i->name) |
if (!name) |
128 |
return gpg_error (GPG_ERR_ENOMEM);; |
return gpg_error (GPG_ERR_ENOMEM);; |
129 |
gpg_decode_c_string (pend, &i->name, strlen (pend)+ 1); |
gpg_decode_c_string (pend, &name, strlen (pend)+ 1); |
130 |
|
i->name = utf8_to_native (name); |
131 |
|
safe_free (name); |
132 |
if (strchr (pend, '<') != NULL && strchr (pend, '>') != NULL) { |
if (strchr (pend, '<') != NULL && strchr (pend, '>') != NULL) { |
133 |
int pos = strchr (i->name, '<')- i->name + 1; |
int pos = strchr (i->name, '<')- i->name + 1; |
134 |
int end = strchr (i->name, '>') - i->name; |
int end = strchr (i->name, '>') - i->name; |
377 |
{ |
{ |
378 |
cmd_sent = 0; |
cmd_sent = 0; |
379 |
cnt = 0; |
cnt = 0; |
|
//resval = 0; |
|
380 |
} |
} |
381 |
|
|
382 |
|
|
483 |
return type; |
return type; |
484 |
} |
} |
485 |
|
|
486 |
|
|
487 |
|
/* Add the notation data from @notation to the user ID |
488 |
|
with the index @_uid_idx. |
489 |
|
Return value: 0 on success. */ |
490 |
|
gpgme_error_t |
491 |
|
GpgKeyEdit::addNotation (int _uid_idx, const char *_notation) |
492 |
|
{ |
493 |
|
if (!key) |
494 |
|
return gpg_error (GPG_ERR_INV_OBJ); |
495 |
|
if (key_has_passwd && !this->pass) |
496 |
|
return gpg_error (GPG_ERR_INV_PASSPHRASE); |
497 |
|
|
498 |
|
type = GPG_EDITKEY_NOTATION; |
499 |
|
this->uid_index = _uid_idx; |
500 |
|
this->notation = (char*)_notation; |
501 |
|
return gpg_editkey (this->ctx, this->key, this); |
502 |
|
} |
503 |
|
|
504 |
|
|
505 |
/* Sign the key stored in the object with the |
/* Sign the key stored in the object with the |
506 |
signing mode @mode and the signature class @sig_class. |
signing mode @mode and the signature class @sig_class. |
507 |
Return value: 0 on success. */ |
Return value: 0 on success. */ |
796 |
return gpg_editkey (this->ctx, this->key, this); |
return gpg_editkey (this->ctx, this->key, this); |
797 |
} |
} |
798 |
|
|
799 |
|
|
800 |
|
/* Remove unusable parts and all signatures from a key. */ |
801 |
|
gpgme_error_t |
802 |
|
GpgKeyEdit::minimizeKey (void) |
803 |
|
{ |
804 |
|
if (!this->key) |
805 |
|
return gpg_error (GPG_ERR_INV_OBJ); |
806 |
|
type = GPG_EDITKEY_MINIMIZE; |
807 |
|
return gpg_editkey (this->ctx, this->key, this); |
808 |
|
} |
809 |
|
|
810 |
|
|
811 |
/* Remove unusable parts from a key. */ |
/* Remove unusable parts from a key. */ |
812 |
gpgme_error_t |
gpgme_error_t |