Trait PrivateSigningKey

Source
pub trait PrivateSigningKey {
    type VerificationKey: JsonWebKey;

    // Required methods
    fn sign(
        &self,
        signature_alg: &<Self::VerificationKey as JsonWebKey>::SigningAlgorithm,
        message: &[u8],
    ) -> Result<Vec<u8>, SigningError>;
    fn as_verification_key(&self) -> Self::VerificationKey;
}
Expand description

Private or symmetric key for signing.

Required Associated Types§

Source

type VerificationKey: JsonWebKey

Corresponding type of JSON Web Key used for verifying signatures produced by this key.

Required Methods§

Source

fn sign( &self, signature_alg: &<Self::VerificationKey as JsonWebKey>::SigningAlgorithm, message: &[u8], ) -> Result<Vec<u8>, SigningError>

Signs the given message using the given signature algorithm.

Source

fn as_verification_key(&self) -> Self::VerificationKey

Converts this key to a JSON Web Key that can be used for verifying signatures.

Implementors§