[−][src]Trait rpki::crypto::signer::Signer
A type that allow creating signatures.
Associated Types
type KeyId
The type used for identifying keys.
type Error: Debug + Display
An operational error happened in the signer.
Required methods
fn create_key(
&mut self,
algorithm: PublicKeyFormat
) -> Result<Self::KeyId, Self::Error>
&mut self,
algorithm: PublicKeyFormat
) -> Result<Self::KeyId, Self::Error>
Creates a new key and returns an identifier.
fn get_key_info(
&self,
key: &Self::KeyId
) -> Result<PublicKey, KeyError<Self::Error>>
&self,
key: &Self::KeyId
) -> Result<PublicKey, KeyError<Self::Error>>
Returns the public key information for the given key.
If the key identified by key
does not exist, returns None
.
fn destroy_key(
&mut self,
key: &Self::KeyId
) -> Result<(), KeyError<Self::Error>>
&mut self,
key: &Self::KeyId
) -> Result<(), KeyError<Self::Error>>
Destroys a key.
Returns whether the key identified by key
existed.
fn sign<D: AsRef<[u8]> + ?Sized>(
&self,
key: &Self::KeyId,
algorithm: SignatureAlgorithm,
data: &D
) -> Result<Signature, SigningError<Self::Error>>
&self,
key: &Self::KeyId,
algorithm: SignatureAlgorithm,
data: &D
) -> Result<Signature, SigningError<Self::Error>>
Signs data.
fn sign_one_off<D: AsRef<[u8]> + ?Sized>(
&self,
algorithm: SignatureAlgorithm,
data: &D
) -> Result<(Signature, PublicKey), Self::Error>
&self,
algorithm: SignatureAlgorithm,
data: &D
) -> Result<(Signature, PublicKey), Self::Error>
Signs data using a one time use keypair.
Returns both the signature and the public key of the key pair, but will not store this key pair.
fn rand(&self, target: &mut [u8]) -> Result<(), Self::Error>
Creates random data.
The method fills the provide bytes slice with random data.