Skip to main content

SigningKey

Trait SigningKey 

Source
pub trait SigningKey {
    // Required methods
    fn sign(
        &self,
        algorithm: SignatureAlgorithm,
        canonical_signed_info: &[u8],
    ) -> Result<Vec<u8>, SigningKeyError>;
    fn public_key_info(&self) -> Result<SigningPublicKeyInfo, SigningKeyError>;

    // Provided method
    fn sign_with_provider(
        &self,
        provider: &dyn CryptoProvider,
        algorithm: SignatureAlgorithm,
        canonical_signed_info: &[u8],
    ) -> Result<Vec<u8>, SigningKeyError> { ... }
}
Expand description

Private key abstraction used by SignContext.

Required Methods§

Source

fn sign( &self, algorithm: SignatureAlgorithm, canonical_signed_info: &[u8], ) -> Result<Vec<u8>, SigningKeyError>

Sign canonicalized <SignedInfo> bytes for the declared XMLDSig method.

Source

fn public_key_info(&self) -> Result<SigningPublicKeyInfo, SigningKeyError>

Return structured public key material corresponding to this signing key.

Provided Methods§

Source

fn sign_with_provider( &self, provider: &dyn CryptoProvider, algorithm: SignatureAlgorithm, canonical_signed_info: &[u8], ) -> Result<Vec<u8>, SigningKeyError>

Sign while sourcing any primitive randomness from the selected provider.

Deterministic or externally managed keys can rely on this default. Keys whose primitive uses randomness, including RSA blinding, must override it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§