Documentation ¶
Index ¶
- Constants
- func DecryptNamespacedData(ctx context.Context, c kclient.Reader, data []byte, namespace string) ([]byte, error)
- func DecryptNamespacedDataMap(ctx context.Context, c kclient.Reader, data map[string][]byte, ...) (map[string][]byte, error)
- func ErrNamespaceKeyNotFound(err error) bool
- func GetPublicKey(ctx context.Context, c kclient.Reader, namespace string) (string, error)
- func IsAcornEncryptedData(data []byte) bool
- func KeyBytesToB64String(key *[32]byte) string
- func NewErrKeyNotFound(ns bool) error
- type EncryptedData
- type ErrDecryptionKeyNotAvailable
- type ErrKeyNotFound
- type ErrUnableToDecrypt
- type MultiEncryptedData
- type NaclKey
- type NaclKeys
Constants ¶
View Source
const ( EncPrefix = "ACORNENC:" EncSuffix = "::" )
Variables ¶
This section is empty.
Functions ¶
func DecryptNamespacedData ¶
func ErrNamespaceKeyNotFound ¶
func GetPublicKey ¶
func IsAcornEncryptedData ¶
func KeyBytesToB64String ¶
func NewErrKeyNotFound ¶
Types ¶
type EncryptedData ¶
type EncryptedData struct { PublicKey string `json:"publicKey"` EncryptedContent string `json:"encryptedContent"` }
func Encrypt ¶
func Encrypt(msg, recipientPublicKey string) (*EncryptedData, error)
func (*EncryptedData) Marshal ¶
func (f *EncryptedData) Marshal() (string, error)
type ErrDecryptionKeyNotAvailable ¶
type ErrDecryptionKeyNotAvailable struct{}
func (*ErrDecryptionKeyNotAvailable) Error ¶
func (d *ErrDecryptionKeyNotAvailable) Error() string
type ErrKeyNotFound ¶
type ErrKeyNotFound struct {
NamespaceKeyNotFound bool
}
func (*ErrKeyNotFound) Error ¶
func (k *ErrKeyNotFound) Error() string
type ErrUnableToDecrypt ¶
type ErrUnableToDecrypt struct {
Errs []error
}
func (*ErrUnableToDecrypt) Error ¶
func (utd *ErrUnableToDecrypt) Error() string
type MultiEncryptedData ¶
func MultipleKeyEncrypt ¶
func MultipleKeyEncrypt(msg string, keys []string) (MultiEncryptedData, error)
func (MultiEncryptedData) Marshal ¶
func (f MultiEncryptedData) Marshal() (string, error)
type NaclKey ¶
type NaclKey struct { AcornNamespace string Primary *bool PublicKey *[32]byte // contains filtered or unexported fields }
func GetPrimaryNaclKey ¶
Click to show internal directories.
Click to hide internal directories.