Struct supervisor_rs::keys_handler::DataWrapper
source · pub struct DataWrapper {
pub data: String,
/* private fields */
}
Expand description
data wrapper including key_name, key_path, and decrypted data inside
Fields§
§data: String
Implementations§
source§impl DataWrapper
impl DataWrapper
pub fn new(kpath: &str, data: &str) -> Result<Self>
sourcepub fn unwrap_from(s: &[u8]) -> Result<(String, &[u8])>
pub fn unwrap_from(s: &[u8]) -> Result<(String, &[u8])>
For server, receive data and parse to (keyname, encrypted data)
sourcepub fn decrypt_with_pubkey<T: HasPublic>(
data: &[u8],
keyname: String,
pubkey: Rsa<T>
) -> Result<Self>
pub fn decrypt_with_pubkey<T: HasPublic>( data: &[u8], keyname: String, pubkey: Rsa<T> ) -> Result<Self>
decrypt
sourcepub fn encrypt_to_bytes(&self) -> Result<Vec<u8>>
pub fn encrypt_to_bytes(&self) -> Result<Vec<u8>>
keyname + ‘;’ + encrypt data
Trait Implementations§
source§impl Debug for DataWrapper
impl Debug for DataWrapper
source§impl PartialEq for DataWrapper
impl PartialEq for DataWrapper
source§fn eq(&self, other: &DataWrapper) -> bool
fn eq(&self, other: &DataWrapper) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for DataWrapper
Auto Trait Implementations§
impl RefUnwindSafe for DataWrapper
impl Send for DataWrapper
impl Sync for DataWrapper
impl Unpin for DataWrapper
impl UnwindSafe for DataWrapper
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