282 |
goto leave; |
goto leave; |
283 |
|
|
284 |
gpgme_data_rewind (out); |
gpgme_data_rewind (out); |
285 |
while (gpg_data_readline (out, buf, sizeof (buf)-1) > 0) |
while (gpg_data_readline (out, buf, DIM (buf)-1) > 0) |
286 |
rev_key_colon_handler (&rev, buf); |
rev_key_colon_handler (&rev, buf); |
287 |
*r_rev = rev; |
*r_rev = rev; |
288 |
|
|
320 |
goto leave; |
goto leave; |
321 |
|
|
322 |
gpgme_data_rewind (out); |
gpgme_data_rewind (out); |
323 |
while (gpg_data_readline (out, buf, sizeof (buf) -1) > 0) |
while (gpg_data_readline (out, buf, DIM (buf) -1) > 0) |
324 |
uid_inf_colon_handler (&inf, buf); |
uid_inf_colon_handler (&inf, buf); |
325 |
|
|
326 |
*r_uinf = inf; |
*r_uinf = inf; |
353 |
} |
} |
354 |
|
|
355 |
|
|
356 |
|
GpgKeyEdit::GpgKeyEdit (void) |
357 |
|
{ |
358 |
|
clear (); |
359 |
|
key = NULL; |
360 |
|
gpgme_new (&ctx); /*FIXME */ |
361 |
|
} |
362 |
|
|
363 |
|
|
364 |
/* Construct an object with the given key in @key. */ |
/* Construct an object with the given key in @key. */ |
365 |
GpgKeyEdit::GpgKeyEdit (gpgme_key_t _key) |
GpgKeyEdit::GpgKeyEdit (gpgme_key_t _key) |
366 |
{ |
{ |
445 |
this->pass = _pass; |
this->pass = _pass; |
446 |
} |
} |
447 |
|
|
448 |
|
|
449 |
|
/* Kludge to allow to handle admin and user PINs. */ |
450 |
|
void |
451 |
|
GpgKeyEdit::setPassphrase2 (const char *_pass2) |
452 |
|
{ |
453 |
|
this->new_pass = _pass2; |
454 |
|
} |
455 |
|
|
456 |
/* Set the current key to @key. */ |
/* Set the current key to @key. */ |
457 |
void |
void |
458 |
GpgKeyEdit::setKey (gpgme_key_t _key) |
GpgKeyEdit::setKey (gpgme_key_t _key) |
629 |
return gpg_editkey (this->ctx, this->key, this); |
return gpg_editkey (this->ctx, this->key, this); |
630 |
} |
} |
631 |
|
|
632 |
|
|
633 |
|
/* Add a new key on a smart card. |
634 |
|
The type is given in @type. */ |
635 |
|
gpgme_error_t |
636 |
|
GpgKeyEdit::addCardKey (int _type) |
637 |
|
{ |
638 |
|
if (!this->key) |
639 |
|
return gpg_error (GPG_ERR_INV_OBJ); |
640 |
|
if (!this->pass) |
641 |
|
return gpg_error (GPG_ERR_INV_PASSPHRASE); |
642 |
|
if (_type < 1 || _type > 3) |
643 |
|
return gpg_error (GPG_ERR_INV_VALUE); |
644 |
|
|
645 |
|
type = GPG_EDITKEY_ADDCARDKEY; |
646 |
|
this->key_index = _type; |
647 |
|
return gpg_editkey (this->ctx, this->key, this); |
648 |
|
} |
649 |
|
|
650 |
|
|
651 |
/* Add a new subkey to the given key. |
/* Add a new subkey to the given key. |
652 |
The new key will have @pubkey_algo as the algorithm |
The new key will have @pubkey_algo as the algorithm |
653 |
and a size of @pubkey_size bits. If valid > 0, the |
and a size of @pubkey_size bits. If valid > 0, the |