Module content_format

Source

Modulesยง

private ๐Ÿ”’

Structsยง

BitwardenLegacyKeyContentFormat
A legacy content format for Bitwarden keys. See ContentFormat::BitwardenLegacyKey
Bytes
A serialized byte array with a specific content format. This is used to represent data that has a specific format, such as UTF-8 encoded text, raw bytes, or COSE keys. The content format is used to determine how the bytes should be interpreted when encrypting or decrypting the data.
CoseKeyContentFormat
Content format for COSE keys.
CoseSign1ContentFormat
Content format for COSE Sign1 messages.
OctetStreamContentFormat
Content format for raw bytes. Used for attachments and send seed keys.
Pkcs8PrivateKeyDerContentFormat
Content format for PKCS8 private keys in DER format.
SpkiPublicKeyDerContentFormat
Content format for SPKI public keys in DER format.
Utf8ContentFormat ๐Ÿ”’
Content format for UTF-8 encoded text. Used for most text messages.

Enumsยง

ContentFormat ๐Ÿ”’
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.

Traitsยง

ConstContentFormat
This trait is used to instantiate different typed byte vectors with a specific content format, using SerializedBytes<C>. This allows for compile-time guarantees about the content format of the serialized bytes. The exception here is the escape hatch using e.g. from(Vec<u8>), which can still be mis-used, but has to be misused explicitly.
CoseContentFormat
A marker trait for COSE content formats.

Type Aliasesยง

BitwardenLegacyKeyBytes
BitwardenLegacyKeyBytes is a type alias for Bytes with BitwardenLegacyKeyContentFormat. This is used for the legacy format for symmetric keys. A description of the format is available in the ContentFormat::BitwardenLegacyKey documentation.
CoseKeyBytes
CoseKeyBytes is a type alias for Bytes with CoseKeyContentFormat. This is used for serialized CoseKey objects.
CoseSign1Bytes
CoseSign1Bytes is a type alias for Bytes with CoseSign1ContentFormat. This is used for serialized COSE Sign1 messages.
OctetStreamBytes
OctetStreamBytes is a type alias for Bytes with OctetStreamContentFormat. This should be used for e.g. attachments and other data without an explicit content format.
Pkcs8PrivateKeyBytes
Pkcs8PrivateKeyBytes is a type alias for Bytes with Pkcs8PrivateKeyDerContentFormat. This is used for PKCS8 private keys in DER format.
SpkiPublicKeyBytes
SpkiPublicKeyBytes is a type alias for Bytes with SpkiPublicKeyDerContentFormat. This is used for SPKI public keys in DER format.
Utf8Bytes ๐Ÿ”’
Utf8Bytes is a type alias for Bytes with Utf8ContentFormat, which is used for any textual data.