pub(crate) enum ContentFormat {
Utf8,
Pkcs8PrivateKey,
SPKIPublicKeyDer,
CoseKey,
CoseSign1,
BitwardenLegacyKey,
OctetStream,
}
Expand description
The content format describes the format of the contained bytes. Message encryption always
happens on the byte level, and this allows determining what format the contained data has. For
instance, an EncString
in most cases contains UTF-8 encoded text. In some cases it may contain
a Pkcs8 private key, or a COSE key. Specifically, for COSE keys, this allows distinguishing
between the old symmetric key format, represented as ContentFormat::OctetStream
, and the new
COSE key format, represented as ContentFormat::CoseKey
.
Variants§
Utf8
UTF-8 encoded text
Pkcs8PrivateKey
Pkcs8 private key DER
SPKIPublicKeyDer
SPKI public key DER
CoseKey
COSE serialized CoseKey
CoseSign1
CoseSign1 message
BitwardenLegacyKey
Bitwarden Legacy Key There are three permissible byte values here:
[u8; 32]
- AES-CBC (no hmac) key. This is to be removed and banned.[u8; 64]
- AES-CBC with HMAC key. This is the v1 userkey key type[u8; >64]
- COSE key. Padded to be larger than 64 bytes.
OctetStream
Stream of bytes
Trait Implementations§
Source§impl Clone for ContentFormat
impl Clone for ContentFormat
Source§fn clone(&self) -> ContentFormat
fn clone(&self) -> ContentFormat
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 ContentFormat
impl Debug for ContentFormat
Source§impl From<ContentFormat> for HeaderBuilder
impl From<ContentFormat> for HeaderBuilder
Source§fn from(format: ContentFormat) -> Self
fn from(format: ContentFormat) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ContentFormat
impl PartialEq for ContentFormat
Source§impl TryFrom<&Header> for ContentFormat
impl TryFrom<&Header> for ContentFormat
impl Copy for ContentFormat
impl StructuralPartialEq for ContentFormat
Auto Trait Implementations§
impl Freeze for ContentFormat
impl RefUnwindSafe for ContentFormat
impl Send for ContentFormat
impl Sync for ContentFormat
impl Unpin for ContentFormat
impl UnwindSafe for ContentFormat
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