Struct loco_protocol::secure::crypto::CryptoStore
source · [−]pub struct CryptoStore { /* private fields */ }Expand description
AES Crypto implementation using aes
Implementations
sourceimpl CryptoStore
impl CryptoStore
sourcepub fn new_with_key(aes_key: [u8; 16]) -> Self
pub fn new_with_key(aes_key: [u8; 16]) -> Self
Create new crypto store using given AES key
pub fn encrypt_aes(
&self,
data: &[u8],
iv: &[u8; 16]
) -> Result<Vec<u8>, CryptoError>
pub fn decrypt_aes(
&self,
data: &[u8],
iv: &[u8; 16]
) -> Result<Vec<u8>, CryptoError>
sourcepub fn encrypt_key(&self, key: &RsaPublicKey) -> Result<Vec<u8>, CryptoError>
pub fn encrypt_key(&self, key: &RsaPublicKey) -> Result<Vec<u8>, CryptoError>
Encrypt AES key using RSA public key
pub fn gen_random(&self, data: &mut [u8])
Trait Implementations
sourceimpl Clone for CryptoStore
impl Clone for CryptoStore
sourcefn clone(&self) -> CryptoStore
fn clone(&self) -> CryptoStore
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations
impl RefUnwindSafe for CryptoStore
impl Send for CryptoStore
impl Sync for CryptoStore
impl Unpin for CryptoStore
impl UnwindSafe for CryptoStore
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more