pub struct RsaParameters {
digest_alg: &'static Algorithm,
padding: &'static RsaPadding,
pss_salt_length: RsaPssSaltLength,
range: RangeInclusive<u32>,
verification_alg: &'static RsaVerificationAlgorithmId,
}Expand description
Parameters for RSA verification.
Two values are equal when they denote the same verification algorithm, e.g.
RSA_PKCS1_2048_8192_SHA256. Algorithms differing in digest algorithm,
padding scheme, RSA PSS salt length, or modulus size range compare unequal.
In short, it is equality of configuration, not equality of effective behavior.
Fields§
§digest_alg: &'static Algorithm§padding: &'static RsaPadding§pss_salt_length: RsaPssSaltLength§range: RangeInclusive<u32>§verification_alg: &'static RsaVerificationAlgorithmIdImplementations§
Source§impl RsaParameters
impl RsaParameters
pub(crate) fn digest_algorithm(&self) -> &'static Algorithm
pub(crate) fn padding(&self) -> &'static RsaPadding
pub(crate) fn pss_salt_length(&self) -> RsaPssSaltLength
pub(crate) fn bit_size_range(&self) -> &RangeInclusive<u32> ⓘ
Source§impl RsaParameters
impl RsaParameters
pub(crate) const fn new( digest_alg: &'static Algorithm, padding: &'static RsaPadding, range: RangeInclusive<u32>, verification_alg: &'static RsaVerificationAlgorithmId, ) -> Self
Sourcepub const fn with_pss_salt_length(self, saltlen: RsaPssSaltLength) -> Self
pub const fn with_pss_salt_length(self, saltlen: RsaPssSaltLength) -> Self
Sets the RSA-PSS salt length to the given value.
This is ignored for PKCS#1 v1.5 parameters.
Due to the requirement of 'static references to the current type in
verification APIs, it is not possible to directly give the result of
this method to them, nor simply re-borrow it. Instead either the
inline &const { rsa_param.with_pss_salt_length(...) } expression
syntax should be used, or the following if Rust below 1.79 is used:
use aws_lc_rs::signature::{self, RsaPssSaltLength};
const VERIFY_ALG: signature::RsaParameters =
signature::RSA_PSS_2048_8192_SHA256.with_pss_salt_length(RsaPssSaltLength::Custom(123));
// Now use `VERIFY_ALG` instead of `RSA_PSS_2048_8192_SHA256`.Sourcepub fn public_modulus_len(public_key: &[u8]) -> Result<u32, Unspecified>
pub fn public_modulus_len(public_key: &[u8]) -> Result<u32, Unspecified>
Parses a DER-encoded RSAPublicKey structure (RFC 8017) to determine its size in bits.
§Errors
error::Unspecified on parse error.
Sourcepub fn min_modulus_len(&self) -> u32
pub fn min_modulus_len(&self) -> u32
Minimum modulus length in bits.
Sourcepub fn max_modulus_len(&self) -> u32
pub fn max_modulus_len(&self) -> u32
Maximum modulus length in bits.