pub struct RSA;Implementations§
Source§impl RSA
impl RSA
pub async fn generate_key_pair( modulus_length: Option<usize>, hash: Option<HashAlgorithm>, ) -> Result<RsaKeyPair, Box<dyn Error>>
pub async fn export_key_public( key: &RsaKeyPair, format: ExportKeyFormat, ) -> Result<Vec<u8>, Box<dyn Error>>
pub async fn export_key_private( key: &RsaKeyPair, format: ExportKeyFormat, ) -> Result<Vec<u8>, Box<dyn Error>>
pub async fn import_key( key_data: &[u8], format: ExportKeyFormat, _for_encryption: bool, hash: Option<HashAlgorithm>, ) -> Result<RsaKeyPair, Box<dyn Error>>
pub async fn encrypt( key: &RsaKeyPair, data: impl AsRef<[u8]>, ) -> Result<Vec<u8>, Box<dyn Error>>
pub async fn decrypt( key: &RsaKeyPair, encrypted_data: impl AsRef<[u8]>, ) -> Result<Vec<u8>, Box<dyn Error>>
pub async fn sign( key: &RsaKeyPair, data: impl AsRef<[u8]>, salt_length: Option<usize>, hash: Option<HashAlgorithm>, ) -> Result<Vec<u8>, Box<dyn Error>>
pub async fn verify( key: &RsaKeyPair, signature: impl AsRef<[u8]>, data: impl AsRef<[u8]>, salt_length: Option<usize>, hash: Option<HashAlgorithm>, ) -> Result<bool, Box<dyn Error>>
Auto Trait Implementations§
impl Freeze for RSA
impl RefUnwindSafe for RSA
impl Send for RSA
impl Sync for RSA
impl Unpin for RSA
impl UnsafeUnpin for RSA
impl UnwindSafe for RSA
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more