key_passphrase Property
The passphrase for the key's secret key (if any).
Syntax
def get_key_passphrase(key_index: int) -> str: ... def set_key_passphrase(key_index: int, value: str) -> None: ...
Default Value
""
Remarks
The passphrase for the key's secret key (if any). This must be specified before operations requiring the secret key are attempted. The passphrase may be supplied in this property or through the on_key_passphrase event, which will fire when a passphrase is required.
The passphrase is required when using the following methods in KeyMgr:
- on_add_user_id
- on_sign_user_id
- on_change_expiration_date
- on_change_passphrase
When using the OpenPGP class, or an email-based class, the following methods require a passphrase for the key:
- on_decrypt
- on_sign
- on_sign_and_encrypt
The key_index parameter specifies the index of the item in the array. The size of the array is controlled by the key_count property.