Documentation ¶
Overview ¶
Package ecjson represents encrypted and compressed content using JSON-based
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrMessageTooLarge = errors.New("ecjson: message too large")
ErrMessageTooLarge is returned if the data is too large to be processed.
Functions ¶
Types ¶
type EncryptedCompressedJSON ¶
type EncryptedCompressedJSON struct {
// contains filtered or unexported fields
}
EncryptedCompressedJSON implements SecureEncoder for JSON using an AEAD cipher.
See https://en.wikipedia.org/wiki/Authenticated_encryption
func (*EncryptedCompressedJSON) Marshal ¶
func (c *EncryptedCompressedJSON) Marshal(s interface{}) ([]byte, error)
Marshal marshals the interface state as JSON, encrypts the JSON using the cipher and base64 encodes the binary value as a string and returns the result
can panic if source of random entropy is exhausted generating a nonce.
func (*EncryptedCompressedJSON) Unmarshal ¶
func (c *EncryptedCompressedJSON) Unmarshal(data []byte, s interface{}) error
Unmarshal takes the marshaled string, base64-decodes into a byte slice, decrypts the byte slice the passed cipher, and unmarshals the resulting JSON into the struct pointer passed