pub enum InMemorySigningKeyPair {
    Ecdsa(EcdsaKeyPairEcdsaCurveVec<u8>),
    Ed25519(Ed25519KeyPair),
    Rsa(RsaKeyPairVec<u8>),
}
Expand description

Represents a key pair that exists in memory and can be used to create cryptographic signatures.

This is a wrapper around ring’s various key pair types. It provides abstractions tailored for X.509 certificates.

Variants

Ecdsa(EcdsaKeyPairEcdsaCurveVec<u8>)

ECDSA key pair.

Ed25519(Ed25519KeyPair)

ED25519 key pair.

Rsa(RsaKeyPairVec<u8>)

RSA key pair.

Implementations

Attempt to instantiate an instance from PKCS#8 DER data.

The DER data should be a OneAsymmetricKey ASN.1 structure.

Attempt to instantiate an instance from PEM encoded PKCS#8.

This is just a wrapper for Self::from_pkcs8_der that does the PEM decoding for you.

Generate a random key pair given a key algorithm and optional ECDSA signing algorithm.

The raw PKCS#8 document is returned to facilitate access to the private key.

Not attempt is made to protect the private key in memory.

Attempt to resolve a verification algorithm for this key pair.

This is a wrapper around SignatureAlgorithm::resolve_verification_algorithm() with our bound KeyAlgorithm. However, since there are no parameters that can result in wrong choices, this is guaranteed to always work and doesn’t require Result.

Trait Implementations

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

👎 Deprecated since 0.13.0:

use the signature::Signer trait instead

This will use a new instance of ring’s SystemRandom. The RSA padding algorithm is hard-coded to RSA_PCS1_SHA256.

If you want total control over signing parameters, obtain the underlying ring keypair and call its .sign().

Obtain the algorithm of the private key. Read more

Obtain the raw bytes constituting the public key of the signing certificate. Read more

Obtain the SignatureAlgorithm that this signer will use. Read more

Obtain the raw private key data.

Obtain RSA key primes p and q, if available.

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

Sign the given message and return a digital signature

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

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

Sign the given message, update the state, and return a digital signature

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.