Skip to main content

Module legacy_compat_symmetric_key_envelope

Module legacy_compat_symmetric_key_envelope 

Source
Expand description

A wrapped symmetric key that is either a legacy EncString or a SymmetricKeyEnvelope.

Use it as the type of a stored wrapped-key field while migrating from EncString to SymmetricKeyEnvelope: both formats deserialize, LegacyCompatSymmetricKeyEnvelope::seal always produces the envelope, LegacyCompatSymmetricKeyEnvelope::seal_legacy the EncString.

In order to migrate, add support via seal_legacy, then three full releases later, switch to seal. This is a breaking change: older clients cannot read the envelope.

  stored field ──deserialize──► EncString ──────────────┐
                              └► SymmetricKeyEnvelope ──┴─unseal─► key ─seal─► SymmetricKeyEnvelope

Enums§

LegacyCompatSymmetricKeyEnvelope
A symmetric key wrapped either as a legacy EncString or as a SymmetricKeyEnvelope.

Constants§

ENC_STRING_TYPE_SEPARATOR 🔒
Separates the type prefix from the payload in an EncString, e.g. 2.iv|data|mac. Base64, used by SymmetricKeyEnvelope, never contains it.

Functions§

map_legacy_error 🔒
Maps key store EncString wrap/unwrap errors onto the envelope error type.