rama::tls::rustls::dep::rcgen

Trait RemoteKeyPair

pub trait RemoteKeyPair {
    // Required methods
    fn public_key(&self) -> &[u8] ;
    fn sign(&self, msg: &[u8]) -> Result<Vec<u8>, Error>;
    fn algorithm(&self) -> &'static SignatureAlgorithm;
}
Expand description

A private key that is not directly accessible, but can be used to sign messages

Trait objects based on this trait can be passed to the KeyPair::from_remote function for generating certificates from a remote and raw private key, for example an HSM.

Required Methods§

fn public_key(&self) -> &[u8]

Returns the public key of this key pair in the binary format as in KeyPair::public_key_raw

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

Signs msg using the selected algorithm

fn algorithm(&self) -> &'static SignatureAlgorithm

Reveals the algorithm to be used when calling sign()

Implementors§