Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encryptable ¶
type Encryptable interface { EncryptJSON(input any) (json.RawMessage, error) DecryptJSON(input json.RawMessage, output any) error }
func NewClearTextEncryptor ¶
func NewClearTextEncryptor(key string) (Encryptable, error)
func NewEncryptor ¶
func NewEncryptor(keySet keyset.Handle) (Encryptable, error)
NewEncryptor encrypts and decrypts JSON payloads using the provided key set. The key set must contain a primary key that is a streaming AEAD primitive.
func NewForKeyOrURI ¶
func NewForKeyOrURI(keyOrURI string) (Encryptable, error)
type EncryptedPayload ¶
type EncryptedPayload struct {
Encrypted []byte `json:"encrypted"`
}
type Encryptor ¶
type Encryptor struct {
// contains filtered or unexported fields
}
func (Encryptor) DecryptJSON ¶
func (e Encryptor) DecryptJSON(input json.RawMessage, output any) error
func (Encryptor) EncryptJSON ¶
func (e Encryptor) EncryptJSON(input any) (json.RawMessage, error)
type NoOpEncryptor ¶
type NoOpEncryptor struct { }
NoOpEncryptor does not encrypt and just passes the input as is.
func (NoOpEncryptor) DecryptJSON ¶
func (n NoOpEncryptor) DecryptJSON(input json.RawMessage, output any) error
func (NoOpEncryptor) EncryptJSON ¶
func (n NoOpEncryptor) EncryptJSON(input any) (json.RawMessage, error)
Click to show internal directories.
Click to hide internal directories.