Skip to main content

CipherProfile

Enum CipherProfile 

Source
#[non_exhaustive]
pub enum CipherProfile { Mozilla, Fips1403Compliant, Fips1402Compliant, Fips1403Validated, Cnsa1, Cnsa2, }
Expand description

A named set of algorithms a Policy allows: cipher suites, key-exchange groups and signature schemes, each profile exactly what its name claims.

A policy lists the profiles it allows (Policy::cipher_profiles); what it offers is their union, in the order of the first listed, narrowed to its TLS versions, to what the crypto provider has, and to Policy::cipher_suites and Policy::kx_groups when set. A TLS version left with no suite is dropped; none left is PeerError::Policy. Profiles are choices, not non-default settings: Policy::non_defaults does not report them.

Text form: mozilla, fips-140-3-compliant, fips-140-2-compliant, fips-140-3-validated, cnsa-1.0, cnsa-2.0.

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.
§

Mozilla

mozilla: Mozilla’s server-side TLS guideline 6.0, intermediate (which holds modern’s): TLS 1.3 AES-128-GCM, AES-256-GCM and ChaCha20-Poly1305; TLS 1.2 ECDHE-ECDSA and ECDHE-RSA with the same three, in Mozilla’s order; X25519MLKEM768 (aws-lc only), X25519, P-256 and P-384; every signature scheme the provider verifies. The default.

§

Fips1403Compliant

fips-140-3-compliant: the FIPS 140-3 approved algorithms for TLS, per NIST SP 800-52 Rev. 2 and SP 800-131A Rev. 2: TLS 1.3 AES-128-GCM and AES-256-GCM; TLS 1.2 ECDHE-ECDSA and ECDHE-RSA with AES-GCM; P-256 and P-384, and with aws-lc SecP256r1MLKEM768, X25519MLKEM768, MLKEM768 and MLKEM1024; RSA-PSS and RSA PKCS#1 with SHA-256/384/512, ECDSA P-256 with SHA-256 and P-384 with SHA-384. No ChaCha20, no X25519 alone, no Ed25519, no ML-DSA. Algorithm selection only; not a FIPS 140-3 validated module; makes no validation claim. It works on either provider.

§

Fips1402Compliant

fips-140-2-compliant: fips-140-3-compliant without the ML-KEM groups, which only a FIPS 140-3 module can have approved. Algorithm selection only, no validation claim. On ring the two lists are the same. Every FIPS 140-2 certificate moved to the CMVP Historical List in September 2026 (usable for existing systems only); the TLS rules themselves (SP 800-52r2, SP 800-131A) are the same for both.

§

Fips1403Validated

fips-140-3-validated: the fips-140-3-compliant list on rustls’s FIPS provider (AWS-LC’s FIPS module, feature fips), whatever Policy::crypto says. Listed alone or with others, the configuration uses that provider, keeps only what the module reports approved (so other listed profiles lose ChaCha20 and X25519), and is refused unless rustls reports it FIPS (ClientConfig::fips() / ServerConfig::fips(), which also needs Policy::require_ems). Validated only as AWS-LC’s CMVP certificate and its tested operating environments state. Without the feature it is PeerError::Policy; CipherProfile::FIPS_VALIDATED_AVAILABLE says which.

§

Cnsa1

cnsa-1.0: NSA’s CNSA 1.0 (CNSSP 15, RFC 9151) as far as rustls goes, on either provider: TLS 1.3 AES-256-GCM-SHA384; TLS 1.2 ECDHE-ECDSA and ECDHE-RSA AES-256-GCM-SHA384; secp384r1; ECDSA P-384 with SHA-384, RSA-PSS with SHA-384 and RSA PKCS#1 with SHA-384 (keys of 3072 bits or more). Not met: the static-RSA and DHE suites and the ffdhe3072/4096 groups RFC 9151 also lists (absent from rustls, and SP 800-131A disallows static RSA), and the 3072-bit floor for RSA-PSS keys (2048-bit keys pass). Needs an identity of P-384 or RSA 3072+: generated identities are P-256.

§

Cnsa2

cnsa-2.0: NSA’s CNSA 2.0 (ML-KEM-1024, ML-DSA-87, AES-256, SHA-384) in the TLS shape of draft-becker-cnsa2-tls-profile-05: TLS 1.3 only, AES-256-GCM-SHA384, MLKEM1024 only, ML-DSA-87 only. Met in full with Crypto::AwsLc; with ring, which has no ML-KEM or ML-DSA, it is PeerError::Policy. The ML-KEM-768 hybrids are category 3, not CNSA 2.0, and are left out; SecP384r1MLKEM1024 is not in rustls and the draft does not use it. Certificates must be signed with ML-DSA-87 along the chain, so the consumer brings its own identity and CA. The TLS profile is an individual draft and this list follows it.

Implementations§

Source§

impl CipherProfile

Source

pub const ALL: &'static [CipherProfile]

Every profile, in the order of the text form’s documentation.

Source

pub const FIPS_VALIDATED_AVAILABLE: bool = false

Whether this build has the FIPS module fips-140-3-validated needs (feature fips).

Source

pub const fn as_str(self) -> &'static str

The text form, such as fips-140-3-compliant.

Trait Implementations§

Source§

impl Clone for CipherProfile

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CipherProfile

Source§

impl Debug for CipherProfile

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CipherProfile

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CipherProfile

Source§

impl FromStr for CipherProfile

Source§

type Err = PeerError

The associated error which can be returned from parsing.
Source§

fn from_str(text: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for CipherProfile

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for CipherProfile

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CipherProfile

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.