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─► SymmetricKeyEnvelopeEnums§
- Legacy
Compat Symmetric KeyEnvelope - A symmetric key wrapped either as a legacy
EncStringor as aSymmetricKeyEnvelope.
Constants§
- ENC_
STRING_ 🔒TYPE_ SEPARATOR - Separates the type prefix from the payload in an
EncString, e.g.2.iv|data|mac. Base64, used bySymmetricKeyEnvelope, never contains it.
Functions§
- map_
legacy_ 🔒error - Maps key store
EncStringwrap/unwrap errors onto the envelope error type.