437 |
this->pass = _pass; |
this->pass = _pass; |
438 |
} |
} |
439 |
|
|
440 |
|
|
441 |
|
/* Kludge to allow to handle admin and user PINs. */ |
442 |
|
void |
443 |
|
GpgKeyEdit::setPassphrase2 (const char *_pass2) |
444 |
|
{ |
445 |
|
this->new_pass = _pass2; |
446 |
|
} |
447 |
|
|
448 |
/* Set the current key to @key. */ |
/* Set the current key to @key. */ |
449 |
void |
void |
450 |
GpgKeyEdit::setKey (gpgme_key_t _key) |
GpgKeyEdit::setKey (gpgme_key_t _key) |
621 |
return gpg_editkey (this->ctx, this->key, this); |
return gpg_editkey (this->ctx, this->key, this); |
622 |
} |
} |
623 |
|
|
624 |
|
|
625 |
|
/* Add a new key on a smart card. |
626 |
|
The type is given in @type. */ |
627 |
|
gpgme_error_t |
628 |
|
GpgKeyEdit::addCardKey (int _type) |
629 |
|
{ |
630 |
|
if (!this->key) |
631 |
|
return gpg_error (GPG_ERR_INV_OBJ); |
632 |
|
if (!this->pass) |
633 |
|
return gpg_error (GPG_ERR_INV_PASSPHRASE); |
634 |
|
if (_type < 1 || _type > 3) |
635 |
|
return gpg_error (GPG_ERR_INV_VALUE); |
636 |
|
|
637 |
|
type = GPG_EDITKEY_ADDCARDKEY; |
638 |
|
this->key_index = _type; |
639 |
|
return gpg_editkey (this->ctx, this->key, this); |
640 |
|
} |
641 |
|
|
642 |
|
|
643 |
/* Add a new subkey to the given key. |
/* Add a new subkey to the given key. |
644 |
The new key will have @pubkey_algo as the algorithm |
The new key will have @pubkey_algo as the algorithm |
645 |
and a size of @pubkey_size bits. If valid > 0, the |
and a size of @pubkey_size bits. If valid > 0, the |