Enum sequoia_openpgp::types::AEADAlgorithm
source · #[non_exhaustive]pub enum AEADAlgorithm {
EAX,
OCB,
Private(u8),
Unknown(u8),
}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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
EAX
EAX mode.
OCB
OCB mode.
Private(u8)
Private algorithm identifier.
Unknown(u8)
Unknown algorithm identifier.
Implementations§
source§impl AEADAlgorithm
impl AEADAlgorithm
source§impl AEADAlgorithm
impl AEADAlgorithm
sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Returns whether this algorithm is supported.
Examples
use sequoia_openpgp as openpgp;
use openpgp::types::AEADAlgorithm;
assert!(! AEADAlgorithm::Private(100).is_supported());Trait Implementations§
source§impl Clone for AEADAlgorithm
impl Clone for AEADAlgorithm
source§fn clone(&self) -> AEADAlgorithm
fn clone(&self) -> AEADAlgorithm
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for AEADAlgorithm
impl Debug for AEADAlgorithm
source§impl Display for AEADAlgorithm
impl Display for AEADAlgorithm
source§impl From<AEADAlgorithm> for u8
impl From<AEADAlgorithm> for u8
source§fn from(s: AEADAlgorithm) -> u8
fn from(s: AEADAlgorithm) -> u8
Converts to this type from the input type.
source§impl From<u8> for AEADAlgorithm
impl From<u8> for AEADAlgorithm
source§impl Hash for AEADAlgorithm
impl Hash for AEADAlgorithm
source§impl Ord for AEADAlgorithm
impl Ord for AEADAlgorithm
source§fn cmp(&self, other: &AEADAlgorithm) -> Ordering
fn cmp(&self, other: &AEADAlgorithm) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<AEADAlgorithm> for AEADAlgorithm
impl PartialEq<AEADAlgorithm> for AEADAlgorithm
source§fn eq(&self, other: &AEADAlgorithm) -> bool
fn eq(&self, other: &AEADAlgorithm) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd<AEADAlgorithm> for AEADAlgorithm
impl PartialOrd<AEADAlgorithm> for AEADAlgorithm
source§fn partial_cmp(&self, other: &AEADAlgorithm) -> Option<Ordering>
fn partial_cmp(&self, other: &AEADAlgorithm) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Copy for AEADAlgorithm
impl Eq for AEADAlgorithm
impl StructuralEq for AEADAlgorithm
impl StructuralPartialEq for AEADAlgorithm
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more