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§
Sourcetype VerificationKey: JsonWebKey
type VerificationKey: JsonWebKey
Corresponding type of JSON Web Key used for verifying signatures produced by this key.
Required Methods§
Sourcefn sign(
&self,
signature_alg: &<Self::VerificationKey as JsonWebKey>::SigningAlgorithm,
message: &[u8],
) -> Result<Vec<u8>, SigningError>
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.
Sourcefn as_verification_key(&self) -> Self::VerificationKey
fn as_verification_key(&self) -> Self::VerificationKey
Converts this key to a JSON Web Key that can be used for verifying signatures.