deltachat::pgp

Function select_pk_for_encryption

source
fn select_pk_for_encryption(
    key: &SignedPublicKey,
) -> Option<SignedPublicKeyOrSubkey<'_>>
Expand description

Select public key or subkey to use for encryption.

First, tries to use subkeys. If none of the subkeys are suitable for encryption, tries to use primary key. Returns None if the public key cannot be used for encryption.

TODO: take key flags and expiration dates into account