Struct botan::Encryptor [−][src]
An object that performs public key encryption
Examples
let rng = botan::RandomNumberGenerator::new_system().unwrap(); let rsa = botan::Privkey::create("RSA", "2048", &rng).unwrap(); let rsa_pub = rsa.pubkey().unwrap(); let enc = botan::Encryptor::new(&rsa_pub, "OAEP(SHA-256)").unwrap(); let ctext = enc.encrypt(&[1,2,3], &rng).unwrap();
Implementations
impl Encryptor
[src]
pub fn new(key: &Pubkey, padding: &str) -> Result<Encryptor>
[src]
Create a new public key encryptor object
pub fn encrypt(
&self,
ptext: &[u8],
rng: &RandomNumberGenerator
) -> Result<Vec<u8>>
[src]
&self,
ptext: &[u8],
rng: &RandomNumberGenerator
) -> Result<Vec<u8>>
Encrypt a message using the provided public key
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Encryptor
impl !Send for Encryptor
impl !Sync for Encryptor
impl Unpin for Encryptor
impl UnwindSafe for Encryptor
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,