pub struct AsymmetricCryptoManager { /* private fields */ }Expand description
非对称加密门面。
Implementations§
Source§impl AsymmetricCryptoManager
impl AsymmetricCryptoManager
pub fn new( registry: Registry<Box<dyn AsymmetricCipher>>, default_identifier: impl Into<String>, ) -> Result<Self>
pub fn encrypt_with( &self, identifier: &str, plaintext: &[u8], public_key_hex: &str, ) -> Result<String>
pub fn decrypt( &self, ciphertext_hex: &str, private_key_hex: &str, ) -> Result<Vec<u8>>
pub fn decrypt_with( &self, identifier: &str, ciphertext_hex: &str, private_key_hex: &str, ) -> Result<Vec<u8>>
pub fn registry(&self) -> &Registry<Box<dyn AsymmetricCipher>>
pub fn registry_mut(&mut self) -> &mut Registry<Box<dyn AsymmetricCipher>>
pub fn default_identifier(&self) -> &str
pub fn set_default_identifier( &mut self, identifier: impl Into<String>, ) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AsymmetricCryptoManager
impl !UnwindSafe for AsymmetricCryptoManager
impl Freeze for AsymmetricCryptoManager
impl Send for AsymmetricCryptoManager
impl Sync for AsymmetricCryptoManager
impl Unpin for AsymmetricCryptoManager
impl UnsafeUnpin for AsymmetricCryptoManager
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