crypto

package
v1.116.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2024 License: Apache-2.0 Imports: 11 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(in []byte) (result []byte, err error)

Decrypt attempts to decrypt the provided data with all registered keys

func Encrypt

func Encrypt(in []byte) []byte

Encrypt encrypts the data with the registered encryption key

func InitFromSecret

func InitFromSecret(clientset kubernetes.Interface, namespace string) error

InitFromSecret reads the encryption key from kubernetes and adds it to the list of decryptionCiphers, and sets this key to be used for encryption.

func InitFromString

func InitFromString(data string) error

InitFromString parses the encryption key from the provided string and adds it to the list of decryptionCiphers

func NewAESCipher

func NewAESCipher() error

NewAESCipher creates a new AES cipher to be used for encryption and decryption. If one already exists, it is used instead.

func ToString

func ToString() string

ToString returns a string representation of the global encryption key

Types

type NoDecryptionKeysErr

type NoDecryptionKeysErr struct{}

func (NoDecryptionKeysErr) Error

func (e NoDecryptionKeysErr) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL