Skip to main content

SigningKey

Type Alias SigningKey 

Source
pub type SigningKey<D> = GenericSigningKey<D, BoxedUint, BoxedMontyParams>;
Available on crate feature alloc only.
Expand description

Signing key for producing RSASSA-PSS signatures as described in RFC8017 § 8.1.

Aliased Type§

pub struct SigningKey<D> { /* private fields */ }

Trait Implementations§

Source§

impl<D> AssociatedAlgorithmIdentifier for SigningKey<D>
where D: Digest,

Available on crate feature encoding only.
Source§

const ALGORITHM_IDENTIFIER: AlgorithmIdentifierRef<'static> = pkcs1::ALGORITHM_ID

AlgorithmIdentifier for this structure.
Source§

type Params = AnyRef<'static>

Algorithm parameters.
Source§

impl<'de, D> Deserialize<'de> for SigningKey<D>
where D: Digest + AssociatedOid,

Available on crate feature serde only.
Source§

fn deserialize<De>(deserializer: De) -> Result<Self, De::Error>
where De: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<D> DynSignatureAlgorithmIdentifier for SigningKey<D>
where D: Digest + AssociatedOid,

Available on crate feature encoding only.
Source§

fn signature_algorithm_identifier(&self) -> Result<AlgorithmIdentifierOwned>

AlgorithmIdentifier for the corresponding signature system. Read more
Source§

impl<D> EncodePrivateKey for SigningKey<D>
where D: Digest,

Available on crate feature encoding only.
Source§

fn to_pkcs8_der(&self) -> Result<SecretDocument>

Serialize a SecretDocument containing a PKCS#8-encoded private key. Read more
Source§

fn to_pkcs8_pem( &self, line_ending: LineEnding, ) -> Result<Zeroizing<String>, Error>

Available on crate feature pem only.
Serialize this private key as PEM-encoded PKCS#8 with the given LineEnding. Read more
Source§

fn write_pkcs8_der_file(&self, path: impl AsRef<Path>) -> Result<(), Error>

Available on crate feature std only.
Write ASN.1 DER-encoded PKCS#8 private key to the given path. Read more
Source§

fn write_pkcs8_pem_file( &self, path: impl AsRef<Path>, line_ending: LineEnding, ) -> Result<(), Error>

Available on crate features pem and std only.
Write ASN.1 PEM-encoded PKCS#8 private key to the given path. Read more
Source§

impl<D> From<GenericRsaPrivateKey<BoxedUint, BoxedMontyParams>> for SigningKey<D>
where D: Digest,

Source§

fn from(key: RsaPrivateKey) -> Self

Converts to this type from the input type.
Source§

impl<D> Keypair for SigningKey<D>
where D: Digest,

Source§

type VerifyingKey = GenericVerifyingKey<D, BoxedUint, BoxedMontyParams>

Verifying key type for this keypair.
Source§

fn verifying_key(&self) -> Self::VerifyingKey

Get the verifying key which can verify signatures produced by the signing key portion of this keypair.
Source§

impl<D> PartialEq for SigningKey<D>
where D: Digest,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<D> RandomizedDigestSigner<D, GenericSignature<BoxedUint>> for SigningKey<D>

Source§

fn try_sign_digest_with_rng<R: TryCryptoRng + ?Sized, F: Fn(&mut D) -> Result<()>>( &self, rng: &mut R, f: F, ) -> Result<Signature>

Attempt to sign a message by updating the received Digest with it, returning a digital signature on success, or an error if something went wrong. Read more
Source§

fn sign_digest_with_rng<R, F>(&self, rng: &mut R, f: F) -> S
where R: CryptoRng + ?Sized, F: Fn(&mut D),

Sign a message by updating the received Digest with it, returning a signature. Read more
Source§

impl<D> RandomizedMultipartSigner<GenericSignature<BoxedUint>> for SigningKey<D>

Source§

fn try_multipart_sign_with_rng<R: TryCryptoRng + ?Sized>( &self, rng: &mut R, msg: &[&[u8]], ) -> Result<Signature>

Equivalent of RandomizedSigner::try_sign_with_rng() but the message is provided in non-contiguous byte slices. Read more
Source§

fn multipart_sign_with_rng<R>(&self, rng: &mut R, msg: &[&[u8]]) -> S
where R: CryptoRng + ?Sized,

Equivalent of RandomizedSigner::sign_with_rng() but the message is provided in non-contiguous byte slices.
Source§

impl<D> RandomizedPrehashSigner<GenericSignature<BoxedUint>> for SigningKey<D>

Source§

fn sign_prehash_with_rng<R: TryCryptoRng + ?Sized>( &self, rng: &mut R, prehash: &[u8], ) -> Result<Signature>

Attempt to sign the given message digest, returning a digital signature on success, or an error if something went wrong. Read more
Source§

impl<D> RandomizedSigner<GenericSignature<BoxedUint>> for SigningKey<D>

Source§

fn try_sign_with_rng<R: TryCryptoRng + ?Sized>( &self, rng: &mut R, msg: &[u8], ) -> Result<Signature>

Attempt to sign the given message, returning a digital signature on success, or an error if something went wrong. Read more
Source§

fn sign_with_rng<R>(&self, rng: &mut R, msg: &[u8]) -> S
where R: CryptoRng + ?Sized,

Sign the given message and return a digital signature
Source§

impl<D> Serialize for SigningKey<D>
where D: Digest,

Available on crate feature serde only.
Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<D> TryFrom<PrivateKeyInfo<AnyRef<'_>, &OctetStringRef, BitStringRef<'_>>> for SigningKey<D>
where D: Digest + AssociatedOid,

Available on crate feature encoding only.
Source§

type Error = Error

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

fn try_from(private_key_info: PrivateKeyInfoRef<'_>) -> Result<Self>

Performs the conversion.
Source§

impl<D> ZeroizeOnDrop for SigningKey<D>
where D: Digest,