Enum sequoia_openpgp::types::AEADAlgorithm [−][src]
Expand description
The AEAD algorithms as defined in Section 9.6 of RFC 4880bis.
The values can be converted into and from their corresponding values of the serialized format.
Use AEADAlgorithm::from
to translate a numeric value to a
symbolic one.
Note: This enum cannot be exhaustively matched to allow future extensions.
This feature is experimental.
Examples
Use AEADAlgorithm
to set the preferred AEAD algorithms on a signature:
use sequoia_openpgp as openpgp;
use openpgp::packet::signature::SignatureBuilder;
use openpgp::types::{Features, HashAlgorithm, AEADAlgorithm, SignatureType};
let features = Features::empty().set_aead();
let mut builder = SignatureBuilder::new(SignatureType::DirectKey)
.set_features(features)?
.set_preferred_aead_algorithms(vec![
AEADAlgorithm::EAX,
])?;
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
EAX mode.
OCB mode.
Private(u8)
Private algorithm identifier.
Tuple Fields of Private
0: u8
Unknown(u8)
Unknown algorithm identifier.
Tuple Fields of Unknown
0: u8
Implementations
Returns whether this algorithm is supported.
Examples
use sequoia_openpgp as openpgp;
use openpgp::types::AEADAlgorithm;
assert!(AEADAlgorithm::EAX.is_supported());
assert!(!AEADAlgorithm::OCB.is_supported());
Trait Implementations
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for AEADAlgorithm
impl Send for AEADAlgorithm
impl Sync for AEADAlgorithm
impl Unpin for AEADAlgorithm
impl UnwindSafe for AEADAlgorithm
Blanket Implementations
Mutably borrows from an owned value. Read more