Trait rsa::PublicKey[][src]

pub trait PublicKey: EncryptionPrimitive + PublicKeyParts {
    fn encrypt<R: Rng>(
        &self,
        rng: &mut R,
        padding: PaddingScheme,
        msg: &[u8]
    ) -> Result<Vec<u8>>;
fn verify(
        &self,
        padding: PaddingScheme,
        hashed: &[u8],
        sig: &[u8]
    ) -> Result<()>; }

Generic trait for operations on a public key.

Required methods

fn encrypt<R: Rng>(
    &self,
    rng: &mut R,
    padding: PaddingScheme,
    msg: &[u8]
) -> Result<Vec<u8>>
[src]

Encrypt the given message.

fn verify(
    &self,
    padding: PaddingScheme,
    hashed: &[u8],
    sig: &[u8]
) -> Result<()>
[src]

Verify a signed message. hashedmust be the result of hashing the input using the hashing function passed in through hash. If the message is valid Ok(()) is returned, otherwiese an Err indicating failure.

Loading content...

Implementors

impl PublicKey for RSAPublicKey[src]

impl<'a> PublicKey for &'a RSAPublicKey[src]

Loading content...