pub struct Signature {
pub(super) inner: Box<[u8]>,
}Expand description
RSASSA-PSS signatures as described in RFC8017 § 8.1.
Decoding with TryFrom or serde accepts at most Self::MAX_LEN bytes.
Use Self::from_bytes_with_max_len to explicitly allow larger signatures.
A signature’s exact length and value are checked during verification.
Fields§
§inner: Box<[u8]>Implementations§
Source§impl Signature
impl Signature
Sourcepub const MAX_LEN: usize
pub const MAX_LEN: usize
Default maximum encoded signature length in bytes.
Corresponds to the default maximum modulus size, PublicKey::MAX_SIZE.
Sourcepub fn from_bytes_with_max_len(bytes: &[u8], max_len: usize) -> Result<Self>
pub fn from_bytes_with_max_len(bytes: &[u8], max_len: usize) -> Result<Self>
Decode a signature with an explicit maximum encoded length in bytes.
The length is checked before allocating. This can be used to accept signatures
for keys larger than PublicKey::MAX_SIZE, or to impose a smaller limit.
The exact length and value are checked against the key during verification.
Signatures larger than Self::MAX_LEN must also use this method when
decoding their serialized bytes again. TryFrom and serde use the default limit.
§Errors
Returns an error if bytes.len() exceeds max_len.
Trait Implementations§
Source§impl<D> DigestVerifier<D, Signature> for VerifyingKey<D>
impl<D> DigestVerifier<D, Signature> for VerifyingKey<D>
impl Eq for Signature
Source§impl<D> MultipartSigner<Signature> for SigningKey<D>where
D: Digest + FixedOutputReset,
Available on crate feature getrandom only.
impl<D> MultipartSigner<Signature> for SigningKey<D>where
D: Digest + FixedOutputReset,
getrandom only.Source§fn try_multipart_sign(&self, msg: &[&[u8]]) -> Result<Signature>
fn try_multipart_sign(&self, msg: &[&[u8]]) -> Result<Signature>
Signer::try_sign() but the message is provided in non-contiguous byte
slices. Read moreSource§fn multipart_sign(&self, msg: &[&[u8]]) -> S
fn multipart_sign(&self, msg: &[&[u8]]) -> S
Signer::sign() but the message is provided in non-contiguous byte slices.Source§impl<D> PrehashSigner<Signature> for SigningKey<D>where
D: Digest + FixedOutputReset,
Available on crate feature getrandom only.
impl<D> PrehashSigner<Signature> for SigningKey<D>where
D: Digest + FixedOutputReset,
getrandom only.Source§impl<D> PrehashVerifier<Signature> for VerifyingKey<D>where
D: Digest + FixedOutputReset,
impl<D> PrehashVerifier<Signature> for VerifyingKey<D>where
D: Digest + FixedOutputReset,
Source§impl<D> RandomizedDigestSigner<D, Signature> for SigningKey<D>
impl<D> RandomizedDigestSigner<D, Signature> for SigningKey<D>
Source§impl<D> RandomizedMultipartSigner<Signature> for SigningKey<D>
impl<D> RandomizedMultipartSigner<Signature> for SigningKey<D>
Source§fn try_multipart_sign_with_rng<R: TryCryptoRng + ?Sized>(
&self,
rng: &mut R,
msg: &[&[u8]],
) -> Result<Signature>
fn try_multipart_sign_with_rng<R: TryCryptoRng + ?Sized>( &self, rng: &mut R, msg: &[&[u8]], ) -> Result<Signature>
RandomizedSigner::try_sign_with_rng() but the message is provided in
non-contiguous byte slices. Read moreSource§fn multipart_sign_with_rng<R>(&self, rng: &mut R, msg: &[&[u8]]) -> S
fn multipart_sign_with_rng<R>(&self, rng: &mut R, msg: &[&[u8]]) -> S
RandomizedSigner::sign_with_rng() but the message is provided in
non-contiguous byte slices.Source§impl<D> RandomizedPrehashSigner<Signature> for SigningKey<D>
impl<D> RandomizedPrehashSigner<Signature> for SigningKey<D>
Source§fn sign_prehash_with_rng<R: TryCryptoRng + ?Sized>(
&self,
rng: &mut R,
prehash: &[u8],
) -> Result<Signature>
fn sign_prehash_with_rng<R: TryCryptoRng + ?Sized>( &self, rng: &mut R, prehash: &[u8], ) -> Result<Signature>
Source§impl<D> RandomizedSigner<Signature> for SigningKey<D>
impl<D> RandomizedSigner<Signature> for SigningKey<D>
Source§fn try_sign_with_rng<R: TryCryptoRng + ?Sized>(
&self,
rng: &mut R,
msg: &[u8],
) -> Result<Signature>
fn try_sign_with_rng<R: TryCryptoRng + ?Sized>( &self, rng: &mut R, msg: &[u8], ) -> Result<Signature>
Source§impl SignatureBitStringEncoding for Signature
Available on crate feature encoding only.
impl SignatureBitStringEncoding for Signature
encoding only.Source§impl SignatureEncoding for Signature
impl SignatureEncoding for Signature
Source§impl<D> Signer<Signature> for SigningKey<D>where
D: Digest + FixedOutputReset,
Available on crate feature getrandom only.
impl<D> Signer<Signature> for SigningKey<D>where
D: Digest + FixedOutputReset,
getrandom only.impl StructuralPartialEq for Signature
Source§impl TryFrom<BitStringRef<'_>> for Signature
Available on crate feature encoding only.
impl TryFrom<BitStringRef<'_>> for Signature
encoding only.