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<()>; }
Expand description
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]
&self,
rng: &mut R,
padding: PaddingScheme,
msg: &[u8]
) -> Result<Vec<u8>>
Expand description
Encrypt the given message.
fn verify(
&self,
padding: PaddingScheme,
hashed: &[u8],
sig: &[u8]
) -> Result<()>[src]
&self,
padding: PaddingScheme,
hashed: &[u8],
sig: &[u8]
) -> Result<()>
Expand description
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.
Implementors
impl PublicKey for RSAPublicKey[src]
impl PublicKey for RSAPublicKey[src]