Enum cryptographic_message_syntax::SigningKey[][src]

pub enum SigningKey {
    Ecdsa(EcdsaKeyPair),
    Ed25519(Ed25519KeyPair),
    Rsa(RsaKeyPair),
}

Represents a key used for signing content.

This is a wrapper around ring’s key types supporting signing. We only care about the private key as this type should only be used for signing.

Variants

ECDSA key pair.

ED25519 key pair.

RSA key pair.

Implementations

impl SigningKey[src]

pub fn from_pkcs8_der(
    data: &[u8],
    ecdsa_signing_algorithm: Option<&'static EcdsaSigningAlgorithm>
) -> Result<Self, CmsError>
[src]

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

The document should be a OneAsymmetricKey data structure and should contain both the private and public key.

pub fn from_pkcs8_pem(
    data: &[u8],
    ecdsa_signing_algorithm: Option<&'static EcdsaSigningAlgorithm>
) -> Result<Self, CmsError>
[src]

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

This is a convenience wrapper for PEM decoding and calling SigningKey::from_pkcs8_der.

pub fn sign(&self, message: &[u8]) -> Result<Vec<u8>, CmsError>[src]

Sign a message using this signing key.

Returns the raw bytes constituting the signature.

pub fn public_key(&self) -> &[u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Obtain the raw bytes constituting the public key for this signing key.

Trait Implementations

impl Debug for SigningKey[src]

impl From<&'_ SigningKey> for SignatureAlgorithm[src]

impl From<EcdsaKeyPair> for SigningKey[src]

impl From<Ed25519KeyPair> for SigningKey[src]

impl From<RsaKeyPair> for SigningKey[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.