Enum cryptographic_message_syntax::SigningKey [−][src]
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(EcdsaKeyPair)
ECDSA key pair.
Ed25519(Ed25519KeyPair)
ED25519 key pair.
Rsa(RsaKeyPair)
RSA key pair.
Implementations
impl SigningKey
[src]
pub fn from_pkcs8_der(
data: &[u8],
ecdsa_signing_algorithm: Option<&'static EcdsaSigningAlgorithm>
) -> Result<Self, CmsError>
[src]
data: &[u8],
ecdsa_signing_algorithm: Option<&'static EcdsaSigningAlgorithm>
) -> Result<Self, CmsError>
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]
data: &[u8],
ecdsa_signing_algorithm: Option<&'static EcdsaSigningAlgorithm>
) -> Result<Self, CmsError>
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]ⓘ
[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]
fn from(key: &SigningKey) -> Self
[src]
impl From<EcdsaKeyPair> for SigningKey
[src]
fn from(key: EcdsaKeyPair) -> Self
[src]
impl From<Ed25519KeyPair> for SigningKey
[src]
fn from(key: Ed25519KeyPair) -> Self
[src]
impl From<RsaKeyPair> for SigningKey
[src]
fn from(key: RsaKeyPair) -> Self
[src]
Auto Trait Implementations
impl RefUnwindSafe for SigningKey
impl Send for SigningKey
impl Sync for SigningKey
impl Unpin for SigningKey
impl UnwindSafe for SigningKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,