[−][src]Enum sequoia_openpgp::types::SymmetricAlgorithm
The symmetric-key algorithms as defined in Section 9.2 of RFC 4880.
The values can be converted into and from their corresponding values of the serialized format.
Use SymmetricAlgorithm::from
to translate a numeric value to a
symbolic one.
Examples
Use SymmetricAlgorithm
to set the preferred symmetric algorithms on a signature:
use sequoia_openpgp as openpgp; use openpgp::packet::signature::SignatureBuilder; use openpgp::types::{HashAlgorithm, SymmetricAlgorithm, SignatureType}; let mut builder = SignatureBuilder::new(SignatureType::DirectKey) .set_hash_algo(HashAlgorithm::SHA512) .set_preferred_symmetric_algorithms(vec![ SymmetricAlgorithm::AES256, ])?;
Variants
Null encryption.
IDEA block cipher.
3-DES in EDE configuration.
CAST5/CAST128 block cipher.
Schneier et.al. Blowfish block cipher.
10-round AES.
12-round AES.
14-round AES.
Twofish block cipher.
18 rounds of NESSIEs Camellia.
24 rounds of NESSIEs Camellia w/192 bit keys.
24 rounds of NESSIEs Camellia w/256 bit keys.
Private(u8)
Private algorithm identifier.
Unknown(u8)
Unknown algorithm identifier.
Implementations
impl SymmetricAlgorithm
[src]
pub fn key_size(self) -> Result<usize>
[src]
Length of a key for this algorithm in bytes. Fails if Sequoia does not support this algorithm.
pub fn block_size(self) -> Result<usize>
[src]
Length of a block for this algorithm in bytes. Fails if Sequoia does not support this algorithm.
impl SymmetricAlgorithm
[src]
pub fn is_supported(&self) -> bool
[src]
Returns whether this algorithm is supported.
Examples
use sequoia_openpgp as openpgp; use openpgp::types::SymmetricAlgorithm; assert!(SymmetricAlgorithm::AES256.is_supported()); assert!(SymmetricAlgorithm::TripleDES.is_supported()); assert!(!SymmetricAlgorithm::IDEA.is_supported()); assert!(!SymmetricAlgorithm::Unencrypted.is_supported()); assert!(!SymmetricAlgorithm::Private(101).is_supported());
Trait Implementations
impl Clone for SymmetricAlgorithm
[src]
fn clone(&self) -> SymmetricAlgorithm
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for SymmetricAlgorithm
[src]
impl Debug for SymmetricAlgorithm
[src]
impl Default for SymmetricAlgorithm
[src]
impl Display for SymmetricAlgorithm
[src]
impl Eq for SymmetricAlgorithm
[src]
impl From<SymmetricAlgorithm> for u8
[src]
fn from(s: SymmetricAlgorithm) -> u8
[src]
impl From<u8> for SymmetricAlgorithm
[src]
impl Hash for SymmetricAlgorithm
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for SymmetricAlgorithm
[src]
fn cmp(&self, other: &SymmetricAlgorithm) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<SymmetricAlgorithm> for SymmetricAlgorithm
[src]
fn eq(&self, other: &SymmetricAlgorithm) -> bool
[src]
fn ne(&self, other: &SymmetricAlgorithm) -> bool
[src]
impl PartialOrd<SymmetricAlgorithm> for SymmetricAlgorithm
[src]
fn partial_cmp(&self, other: &SymmetricAlgorithm) -> Option<Ordering>
[src]
fn lt(&self, other: &SymmetricAlgorithm) -> bool
[src]
fn le(&self, other: &SymmetricAlgorithm) -> bool
[src]
fn gt(&self, other: &SymmetricAlgorithm) -> bool
[src]
fn ge(&self, other: &SymmetricAlgorithm) -> bool
[src]
impl StructuralEq for SymmetricAlgorithm
[src]
impl StructuralPartialEq for SymmetricAlgorithm
[src]
Auto Trait Implementations
impl RefUnwindSafe for SymmetricAlgorithm
impl Send for SymmetricAlgorithm
impl Sync for SymmetricAlgorithm
impl Unpin for SymmetricAlgorithm
impl UnwindSafe for SymmetricAlgorithm
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,