153 |
|
|
154 |
/* Same as mapi_send_pubkey but there is an additional note. */ |
/* Same as mapi_send_pubkey but there is an additional note. */ |
155 |
int |
int |
156 |
mapi_send_pubkey_ext (gpgme_key_t to, const char *keyfile, int flags) |
mapi_send_pubkey_ext (winpt_key_t key, const char *keyfile, int flags) |
157 |
{ |
{ |
158 |
LHANDLE hd; |
LHANDLE hd; |
159 |
MapiMessage *msg; |
MapiMessage *msg; |
160 |
MapiRecipDesc *recip; |
MapiRecipDesc *recip; |
161 |
MapiFileDesc *attch; |
MapiFileDesc *attch; |
162 |
|
gpgme_key_t to = key->ctx; |
163 |
char *p, *kinf; |
char *p, *kinf; |
164 |
const char *s; |
const char *s; |
165 |
int rc; |
int rc; |
186 |
"to verify its signatures.\n" |
"to verify its signatures.\n" |
187 |
"\n" |
"\n" |
188 |
"If you don't have WinPT, you can download it at http://www.winpt.org"; |
"If you don't have WinPT, you can download it at http://www.winpt.org"; |
189 |
kinf = km_key_get_info (to, 0); |
kinf = km_key_get_info (key, 0); |
190 |
p = (char*)malloc (strlen (s) + strlen (kinf) + 2); |
p = (char*)malloc (strlen (s) + strlen (kinf) + 2); |
191 |
sprintf (p, s, kinf); |
sprintf (p, s, kinf); |
192 |
free_if_alloc (kinf); |
free_if_alloc (kinf); |
239 |
int |
int |
240 |
mapi_send_pubkey (const char *keyid, char *keyfile) |
mapi_send_pubkey (const char *keyid, char *keyfile) |
241 |
{ |
{ |
242 |
gpgme_key_t key; |
winpt_key_s key; |
243 |
|
|
244 |
get_pubkey (keyid, &key); |
memset (&key, 0, sizeof (key)); |
245 |
return mapi_send_pubkey_ext (key, keyfile, 0); |
if (winpt_get_pubkey (keyid, &key)) |
246 |
|
return -1; |
247 |
|
return mapi_send_pubkey_ext (&key, keyfile, 0); |
248 |
} |
} |