#[non_exhaustive]pub enum CipherSuite {
Cv25519,
Cv448,
RSA3k,
P256,
P384,
P521,
RSA2k,
RSA4k,
MLDSA65_Ed25519,
MLDSA87_Ed448,
}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(Some("alice@example.org"))
.set_cipher_suite(CipherSuite::Cv25519)
.generate()?;
assert_eq!(ecc.primary_key().key().pk_algo(), PublicKeyAlgorithm::EdDSA);
let (rsa, _) =
CertBuilder::general_purpose(Some("alice@example.org"))
.set_cipher_suite(CipherSuite::RSA4k)
.generate()?;
assert_eq!(rsa.primary_key().key().pk_algo(), PublicKeyAlgorithm::RSAEncryptSign);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Cv25519
EdDSA and ECDH over Curve25519 with SHA512 and AES256
Cv448
EdDSA and ECDH over Curve448 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
MLDSA65_Ed25519
Composite signature algorithm MLDSA65+Ed25519, and composite KEM MLKEM768+X25519.
MLDSA87_Ed448
Composite signature algorithm MLDSA78+Ed448, and composite KEM MLKEM1024+X448.
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
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CipherSuite
Source§impl Debug for CipherSuite
impl Debug for CipherSuite
Source§impl Default for CipherSuite
impl Default for CipherSuite
impl Eq for CipherSuite
Source§impl PartialEq for CipherSuite
impl PartialEq for CipherSuite
Source§fn eq(&self, other: &CipherSuite) -> bool
fn eq(&self, other: &CipherSuite) -> bool
self and other values to be equal, and is used by ==.