Struct dco3_crypto::PlainFileKey
source · pub struct PlainFileKey {
pub key: String,
pub iv: String,
pub version: PlainFileKeyVersion,
pub tag: Option<String>,
}
Expand description
Represents the encrypted file key Contains key, iv and tag used for decryption key, iv, and tag are base64 encoded bytes key is the plain base64 encoded random bytes used
Fields§
§key: String
§iv: String
§version: PlainFileKeyVersion
§tag: Option<String>
Implementations§
source§impl PlainFileKey
impl PlainFileKey
sourcepub fn new_from_file_key(enc_file_key: FileKey, plain_file_key: &str) -> Self
pub fn new_from_file_key(enc_file_key: FileKey, plain_file_key: &str) -> Self
Create a plain file key used for symmetric encryption / decryption (AES256 GCM) Accepts the encrypted file key and the plain file key (base64 encoded) Returns the plain file key
pub fn try_new_for_encryption() -> Result<Self, DracoonCryptoError>
pub fn set_tag(&mut self, tag: String)
Trait Implementations§
source§impl Clone for PlainFileKey
impl Clone for PlainFileKey
source§fn clone(&self) -> PlainFileKey
fn clone(&self) -> PlainFileKey
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PlainFileKey
impl Debug for PlainFileKey
source§impl<'de> Deserialize<'de> for PlainFileKey
impl<'de> Deserialize<'de> for PlainFileKey
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 PlainFileKey
impl RefUnwindSafe for PlainFileKey
impl Send for PlainFileKey
impl Sync for PlainFileKey
impl Unpin for PlainFileKey
impl UnwindSafe for PlainFileKey
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