[][src]Trait pgp::types::PublicKeyTrait

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

Required methods

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

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

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

Encrypt the given plain for this key.

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

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

Loading content...

Implementations on Foreign Types

impl<'a, T: PublicKeyTrait> PublicKeyTrait for &'a T[src]

Loading content...

Implementors

impl PublicKeyTrait for pgp::composed::key::PublicKey[src]

impl PublicKeyTrait for pgp::composed::key::PublicSubkey[src]

impl PublicKeyTrait for SignedPublicKey[src]

impl PublicKeyTrait for SignedPublicSubKey[src]

impl PublicKeyTrait for SignedSecretKey[src]

impl PublicKeyTrait for SignedSecretSubKey[src]

impl PublicKeyTrait for pgp::packet::PublicKey[src]

impl PublicKeyTrait for pgp::packet::PublicSubkey[src]

impl PublicKeyTrait for SecretKey[src]

impl PublicKeyTrait for SecretSubkey[src]

Loading content...