pub struct XChaCha20Poly1305Key {
pub(crate) key_id: [u8; 16],
pub(crate) enc_key: Pin<Box<GenericArray<u8, U32>>>,
pub(crate) supported_operations: Vec<KeyOperation>,
}Expand description
XChaCha20Poly1305Key is a symmetric encryption key consisting of one 256-bit key, and contains a key id. In contrast to the Aes256CbcKey and Aes256CbcHmacKey, this key type is used to create CoseEncrypt0 messages.
Fields§
§key_id: [u8; 16]§enc_key: Pin<Box<GenericArray<u8, U32>>>§supported_operations: Vec<KeyOperation>Controls which key operations are allowed with this key. Note: Only checking decrypt is
implemented right now, and implementing is tracked here https://bitwarden.atlassian.net/browse/PM-27513.
Further, disabling decrypt will also disable unwrap. The only use-case so far is
DataEnvelope.
Implementations§
Source§impl XChaCha20Poly1305Key
impl XChaCha20Poly1305Key
Sourcepub fn make() -> Self
pub fn make() -> Self
Creates a new XChaCha20Poly1305Key with a securely sampled cryptographic key and key id.
pub(crate) fn disable_key_operation(&mut self, op: KeyOperation) -> &mut Self
Trait Implementations§
Source§impl Clone for XChaCha20Poly1305Key
impl Clone for XChaCha20Poly1305Key
Source§fn clone(&self) -> XChaCha20Poly1305Key
fn clone(&self) -> XChaCha20Poly1305Key
Returns a duplicate 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 XChaCha20Poly1305Key
impl Debug for XChaCha20Poly1305Key
Source§impl PartialEq for XChaCha20Poly1305Key
impl PartialEq for XChaCha20Poly1305Key
Auto Trait Implementations§
impl Freeze for XChaCha20Poly1305Key
impl RefUnwindSafe for XChaCha20Poly1305Key
impl Send for XChaCha20Poly1305Key
impl Sync for XChaCha20Poly1305Key
impl Unpin for XChaCha20Poly1305Key
impl UnwindSafe for XChaCha20Poly1305Key
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,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<> Read moreSource§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