Documentation ¶
Index ¶
Constants ¶
const ( // Version is the current package fmt ver. Version = "0.0.1" // InvalidToken is an invalid sparse token. InvalidToken = "" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Format ¶
type Format string
Format is the package fmt. Currently only secure & sparse formats are supported.
type Package ¶
type Package struct { Version string Format Format Compressed bool EncoderID string Token string Cipher []byte Encoded []byte }
Package is returned by DecodePackage.
- Secure: If the package fmt Format is Secure, Package contains the encrypted ciphertext Cipher containing a fully encoded JSON object.
- Sparse: If the package Format is Sparse, the encrypted ciphertext Cipher contains a lookup table of secure values. Encoded contains a plaintext enc JSON with its secure fields removed and replaced with a secure lookup token consisting of a prefixed EncoderID with the fmt "[prefix]-[encoder id]" (SEE: NewLookupToken) and an index into the lookup table.
func DecodePackage ¶
DecodePackage takes packaged data and returns the ciphertext and encoding block.