Trait pgp::types::SecretKeyTrait

source ·
pub trait SecretKeyTrait: PublicKeyTrait {
    type PublicKey;

    // Required methods
    fn unlock<F, G>(&self, pw: F, work: G) -> Result<()>
       where F: FnOnce() -> String,
             G: FnOnce(&SecretKeyRepr) -> Result<()>;
    fn create_signature<F>(
        &self,
        key_pw: F,
        hash: HashAlgorithm,
        data: &[u8]
    ) -> Result<Vec<Mpi>>
       where F: FnOnce() -> String;
    fn public_key(&self) -> Self::PublicKey;
}

Required Associated Types§

Required Methods§

source

fn unlock<F, G>(&self, pw: F, work: G) -> Result<()>
where F: FnOnce() -> String, G: FnOnce(&SecretKeyRepr) -> Result<()>,

source

fn create_signature<F>( &self, key_pw: F, hash: HashAlgorithm, data: &[u8] ) -> Result<Vec<Mpi>>
where F: FnOnce() -> String,

source

fn public_key(&self) -> Self::PublicKey

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a, T: SecretKeyTrait> SecretKeyTrait for &'a T

§

type PublicKey = <T as SecretKeyTrait>::PublicKey

source§

fn unlock<F, G>(&self, pw: F, work: G) -> Result<()>
where F: FnOnce() -> String, G: FnOnce(&SecretKeyRepr) -> Result<()>,

source§

fn create_signature<F>( &self, key_pw: F, hash: HashAlgorithm, data: &[u8] ) -> Result<Vec<Mpi>>
where F: FnOnce() -> String,

source§

fn public_key(&self) -> Self::PublicKey

Implementors§