Struct crypt_guard::KeyControl::Key
source · pub struct Key { /* private fields */ }Expand description
Represents a cryptographic key, including its type and raw content.
Implementations§
source§impl Key
impl Key
Represents a cryptographic key with its type and content. It provides functionalities to manipulate and store keys in various formats.
sourcepub fn new_public_key(key: Vec<u8>) -> Self
pub fn new_public_key(key: Vec<u8>) -> Self
Factory methods for creating specific types of keys by building new Self elements.
pub fn new_secret_key(key: Vec<u8>) -> Self
pub fn new_ciphertext(key: Vec<u8>) -> Self
sourcepub fn get(&self) -> Result<&Key, CryptError>
pub fn get(&self) -> Result<&Key, CryptError>
Accessors for the key’s properties.
pub fn key_type(&self) -> Result<&KeyTypes, CryptError>
pub fn content(&self) -> Result<&[u8], CryptError>
Trait Implementations§
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more