on_key_passphrase Event
Fired if the passphrase of current key is incorrect or empty.
Syntax
class PSMTPKeyPassphraseEventParams(object): @property def user_id() -> str: ... @property def key_id() -> str: ... @property def passphrase() -> str: ... @passphrase.setter def passphrase(value) -> None: ... # In class PSMTP: @property def on_key_passphrase() -> Callable[[PSMTPKeyPassphraseEventParams], None]: ... @on_key_passphrase.setter def on_key_passphrase(event_hook: Callable[[PSMTPKeyPassphraseEventParams], None]) -> None: ...
Remarks
This event fires when the passphrase for the key is required. The passphrase must be specified before operations requiring the secret key are attempted. The passphrase may be supplied by setting the Passphrase parameter in this event, or by specifying the key_passphrase property before attempting the operation.
The passphrase is required when using the following methods in KeyMgr:
- add_user_id
- sign_user_id
- change_expiration_date
- change_passphrase
When using the OpenPGP class, or an email-based class, the following methods require a passphrase for the key:
- decrypt
- sign
- sign_and_encrypt