Enum sequoia_openpgp::cert::CipherSuite
source · pub enum CipherSuite {
Cv25519,
RSA3k,
P256,
P384,
P521,
RSA2k,
RSA4k,
}
Expand description
Groups symmetric and asymmetric algorithms.
This is used to select a suite of ciphers.
§Examples
use sequoia_openpgp as openpgp;
use openpgp::cert::prelude::*;
use openpgp::types::PublicKeyAlgorithm;
let (ecc, _) =
CertBuilder::general_purpose(None, Some("alice@example.org"))
.set_cipher_suite(CipherSuite::Cv25519)
.generate()?;
assert_eq!(ecc.primary_key().pk_algo(), PublicKeyAlgorithm::EdDSA);
let (rsa, _) =
CertBuilder::general_purpose(None, Some("alice@example.org"))
.set_cipher_suite(CipherSuite::RSA4k)
.generate()?;
assert_eq!(rsa.primary_key().pk_algo(), PublicKeyAlgorithm::RSAEncryptSign);
Variants§
Cv25519
EdDSA and ECDH over Curve25519 with SHA512 and AES256
RSA3k
3072 bit RSA with SHA512 and AES256
P256
EdDSA and ECDH over NIST P-256 with SHA256 and AES256
P384
EdDSA and ECDH over NIST P-384 with SHA384 and AES256
P521
EdDSA and ECDH over NIST P-521 with SHA512 and AES256
RSA2k
2048 bit RSA with SHA512 and AES256
RSA4k
4096 bit RSA with SHA512 and AES256
Implementations§
source§impl CipherSuite
impl CipherSuite
sourcepub fn variants() -> impl Iterator<Item = CipherSuite>
pub fn variants() -> impl Iterator<Item = CipherSuite>
Returns an iterator over CipherSuite
’s variants.
sourcepub fn is_supported(&self) -> Result<()>
pub fn is_supported(&self) -> Result<()>
Returns whether the currently selected cryptographic backend supports the encryption and signing algorithms that the cipher suite selects.
Trait Implementations§
source§impl Clone for CipherSuite
impl Clone for CipherSuite
source§fn clone(&self) -> CipherSuite
fn clone(&self) -> CipherSuite
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 CipherSuite
impl Debug for CipherSuite
source§impl Default for CipherSuite
impl Default for CipherSuite
source§impl Ord for CipherSuite
impl Ord for CipherSuite
source§fn cmp(&self, other: &CipherSuite) -> Ordering
fn cmp(&self, other: &CipherSuite) -> 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 for CipherSuite
impl PartialEq for CipherSuite
source§fn eq(&self, other: &CipherSuite) -> bool
fn eq(&self, other: &CipherSuite) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for CipherSuite
impl PartialOrd for CipherSuite
source§fn partial_cmp(&self, other: &CipherSuite) -> Option<Ordering>
fn partial_cmp(&self, other: &CipherSuite) -> 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 CipherSuite
impl Eq for CipherSuite
impl StructuralPartialEq for CipherSuite
Auto Trait Implementations§
impl Freeze for CipherSuite
impl RefUnwindSafe for CipherSuite
impl Send for CipherSuite
impl Sync for CipherSuite
impl Unpin for CipherSuite
impl UnwindSafe for CipherSuite
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)