ejson

package
v0.0.0-...-cb937e8 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// PublicKeyField is the field name of the public key in the ejson
	PublicKeyField = "_public_key"
	// DecryptionEjsonExt is the extension of the file containing an ejson prviate key
	// file
	DecryptionEjsonExt = ".key"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EjsonDecryptor

type EjsonDecryptor struct {

	// Interface decryptor config
	Config decryptors.DecryptorConfig
	// contains filtered or unexported fields
}

func NewEJSONDecryptor

func NewEJSONDecryptor(config decryptors.DecryptorConfig, keyDirectory string, keys ...string) (*EjsonDecryptor, error)

Initialize a new EJSON Decryptor

func (*EjsonDecryptor) AddKey

func (d *EjsonDecryptor) AddKey(key string) error

func (*EjsonDecryptor) Decrypt

func (d *EjsonDecryptor) Decrypt(data []byte) (content map[string]interface{}, err error)

Read an ejson file Skip decryption still removes the publicKeyField

func (*EjsonDecryptor) IsEncrypted

func (d *EjsonDecryptor) IsEncrypted(data []byte) (bool, error)

func (*EjsonDecryptor) KeysFromSecret

func (d *EjsonDecryptor) KeysFromSecret(secretName string, namespace string, client *kubernetes.Clientset, ctx context.Context) (err error)

Load Keys from Kubernetes Secret Only keys within the secret with the extension .key will be loaded as ejson private keys

Jump to

Keyboard shortcuts

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