Struct snapper_box::crypto::key::DerivedKey[][src]

pub struct DerivedKey { /* fields omitted */ }
Expand description

A key that has been derived from a RootKey

This will have an encryption key and an hmac key derived from the RootKey’s entropy pool, using Blake3 in key-derivation mode, keyed with the RootKey’s hmac key.

This struct also contains the context string that was used to derive it, as a way to validate key provenance, or possibly reconstruct a key after a corruption occurs.

Implementations

Encrypts the given DerivedKey into an EncryptedDerivedKey using the given RootKey.

This method packs the derived key into a ClearText box, and then encrypts it to a CipherText box, without enabling compression.

See the documentation for CipherText for a description of the encryption method.

Errors

Will error if the encryption or serialization fail

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Deserialize this value from the given Serde deserializer. Read more

Executes the destructor for this type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Provides the encryption key as a chacha Key

Provides the hmac key

Serialize this value into the given Serde serializer. Read more

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more