Documentation ¶
Overview ¶
Package secrets is an interface for encrypting and decrypting secrets
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec interface { Init(...Option) error Options() Options String() string Decrypt([]byte, ...DecryptOption) ([]byte, error) Encrypt([]byte, ...EncryptOption) ([]byte, error) }
Codec encrypts or decrypts arbitrary data. The data should be as small as possible
type DecryptOption ¶
type DecryptOption func(*DecryptOptions)
DecryptOption sets DecryptOptions
func SenderPublicKey ¶
func SenderPublicKey(key []byte) DecryptOption
SenderPublicKey is the Public Key of the Codec that encrypted this message
type DecryptOptions ¶
type DecryptOptions struct {
SenderPublicKey []byte
}
DecryptOptions can be passed to Codec.Decrypt
type EncryptOption ¶
type EncryptOption func(*EncryptOptions)
EncryptOption Sets EncryptOptions
func RecipientPublicKey ¶
func RecipientPublicKey(key []byte) EncryptOption
RecipientPublicKey is the Public Key of the Codec that will decrypt this message
type EncryptOptions ¶
type EncryptOptions struct {
RecipientPublicKey []byte
}
EncryptOptions can be passed to Codec.Encrypt
Directories ¶
Path | Synopsis |
---|---|
Package box is an asymmetric implementation of config/secrets using nacl/box
|
Package box is an asymmetric implementation of config/secrets using nacl/box |
Package secretbox is a config/secrets implementation that uses nacl/secretbox to do symmetric encryption / verification
|
Package secretbox is a config/secrets implementation that uses nacl/secretbox to do symmetric encryption / verification |
Click to show internal directories.
Click to hide internal directories.