RawSigningKey

Trait RawSigningKey 

Source
pub trait RawSigningKey {
    // Required methods
    fn key_id(&self) -> String;
    fn sign(&self, digest: &[u8]) -> Result<Vec<Vec<u8>>, Error>;
    fn certificate(&self) -> Result<Option<Vec<u8>>, Error>;
    fn public(&self) -> Result<RawPublicKey, Error>;
}
Expand description

Represents a signing key for low-level operations.

Required Methods§

Source

fn key_id(&self) -> String

Returns key identifier as a string.

Each signing key has an identifier in a implementation defined format. This function will convert that to a String.

Source

fn sign(&self, digest: &[u8]) -> Result<Vec<Vec<u8>>, Error>

Signs a raw digest.

The digest is without any framing and the result should be a vector of raw signature parts.

§Errors

If the operation fails, the implementation should return an appropriate error. The Error::Hsm variant is appropriate for forwarding client-specific HSM errors.

Source

fn certificate(&self) -> Result<Option<Vec<u8>>, Error>

Returns certificate bytes associated with this signing key, if any.

This interface does not interpret the certificate in any way but only reflects on whether a certificate is set or not.

§Errors

If the operation fails, the implementation should return an appropriate error. The Error::Hsm variant is appropriate for forwarding client-specific HSM errors.

Source

fn public(&self) -> Result<RawPublicKey, Error>

Returns raw public parts of the signing key.

The implementation of the RawSigningKey trait implies that a signing key exists and also provides public parts. The returned RawPublicKey is used for generating technology-specific certificates.

§Errors

If the operation fails, the implementation should return an appropriate error. The Error::Hsm variant is appropriate for forwarding client-specific HSM errors.

Implementors§