pub trait PublicKeyTrait: KeyTrait {
    // Required methods
    fn verify_signature(
        &self,
        hash: HashAlgorithm,
        data: &[u8],
        sig: &[Mpi]
    ) -> Result<(), Error>;
    fn encrypt<R>(
        &self,
        rng: &mut R,
        plain: &[u8]
    ) -> Result<Vec<Mpi, Global>, Error>
       where R: CryptoRng + Rng;
    fn to_writer_old(&self, writer: &mut impl Write) -> Result<(), Error>;
}

Required Methods§

source

fn verify_signature( &self, hash: HashAlgorithm, data: &[u8], sig: &[Mpi] ) -> Result<(), Error>

Verify a signed message. Data will be hashed using hash, before verifying.

source

fn encrypt<R>( &self, rng: &mut R, plain: &[u8] ) -> Result<Vec<Mpi, Global>, Error>where R: CryptoRng + Rng,

Encrypt the given plain for this key.

source

fn to_writer_old(&self, writer: &mut impl Write) -> Result<(), Error>

This is the data used for hashing in a signature. Only uses the public portion of the key.

Implementations on Foreign Types§

source§

impl<'a, T> PublicKeyTrait for &'a Twhere T: PublicKeyTrait,

source§

fn verify_signature( &self, hash: HashAlgorithm, data: &[u8], sig: &[Mpi] ) -> Result<(), Error>

source§

fn encrypt<R>( &self, rng: &mut R, plain: &[u8] ) -> Result<Vec<Mpi, Global>, Error>where R: CryptoRng + Rng,

source§

fn to_writer_old(&self, writer: &mut impl Write) -> Result<(), Error>

Implementors§