pub struct SecretEncryption {
nonce: [u8; 12],
ciphertext: Vec<u8>,
}
Fields§
§nonce: [u8; 12]
§ciphertext: Vec<u8>
Implementations§
source§impl SecretEncryption
impl SecretEncryption
pub fn encrypt(key: &[u8], plaintext: &[u8]) -> SecretResult<Self>
pub fn decrypt(&self, key: &[u8]) -> SecretResult<Vec<u8>>
fn fill_key(key: &[u8]) -> Vec<u8>
pub fn serialize(&self) -> SecretResult<Vec<u8>>
pub fn deserialize(data: &[u8]) -> SecretResult<Self>
Trait Implementations§
source§impl<'de> Deserialize<'de> for SecretEncryption
impl<'de> Deserialize<'de> for SecretEncryption
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SecretEncryption
impl RefUnwindSafe for SecretEncryption
impl Send for SecretEncryption
impl Sync for SecretEncryption
impl Unpin for SecretEncryption
impl UnwindSafe for SecretEncryption
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request