Documentation ¶
Overview ¶
Envelope encryption - envelope contains secret content encrypted with NaCl secretbox symmetric key, and that key is separately encrypted for each RSA public key recipient.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Envelope ¶
type Envelope struct { KeySlots []envelopeKeySlot `json:"key_slots"` EncryptedContent []byte `json:"content"` // nonce || secretbox_ciphertext }
func (*Envelope) Marshal ¶
Format:
uvarint version (always 1) uvarint length of EncryptedContent []byte EncryptedContent uvarint amount of key slots
for each key slot
uvarint length of KekId string KekId uvarint length of DekEncrypted []byte DekEncrypted
NOTE: I would've gladly used Protobuf, but looks like you need a metric shit-ton of
imported (even runtime) code to use it.
Click to show internal directories.
Click to hide internal directories.