#[non_exhaustive]pub enum RsaPssSaltLength {
Digest,
Max,
Custom(u16),
}Expand description
An RSA-PSS padding salt length.
If a non-default value is used for a signature, then a matching verification should also use the same value, otherwise it will fail.
Using this type with PSS is FIPS-approved only when the salt length equals
the digest length, i.e. either when Self::Digest or Self::Custom is
used, and the latter with that digest length given. Self::Max or any
other value passed into Self::Custom will not be FIPS-approved.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Digest
The salt length is set to the length of the used digest algorithm.
Corresponds to RSA_PSS_SALTLEN_DIGEST. This is the default.
Max
The salt length is set to the maximum possible length with respect to the used digest algorithm and public key.
This corresponds to emLen - hLen - 2, where
emLenis(pub_key_size_bits + 6) / 8, so depends on the mod size;hLenis the digest algorithm’s output length;
A verification of a signature produced using this salt length may only work when also using this maximum length, not any length up to it.
Custom(u16)
The salt length is set to the given custom value.
The passed value is not particularly checked here, so may ultimately result in failures.
Implementations§
Source§impl RsaPssSaltLength
impl RsaPssSaltLength
pub(crate) fn into_value( self, algorithm: &'static Algorithm, pkey: &ManagedPointer<*mut EVP_PKEY>, ) -> Result<c_int, ()>
Trait Implementations§
Source§impl Clone for RsaPssSaltLength
impl Clone for RsaPssSaltLength
Source§fn clone(&self) -> RsaPssSaltLength
fn clone(&self) -> RsaPssSaltLength
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more