encryption

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AES256Algorithm = "AES256"
)

Variables

This section is empty.

Functions

func AddEncryptedStateStore

func AddEncryptedStateStore(storeName string, keys ComponentEncryptionKeys) bool

AddEncryptedStateStore adds an encrypted state store and an associated encryption key to a list.

func EncryptedStateStore

func EncryptedStateStore(storeName string) bool

EncryptedStateStore returns a bool that indicates if a state stores supports encryption.

func TryDecryptValue

func TryDecryptValue(storeName string, value []byte) ([]byte, error)

TryDecryptValue will try to decrypt a byte array if the state store has associated encryption keys. If no encryption keys exist, the function will return the bytes unmodified.

func TryEncryptValue

func TryEncryptValue(storeName string, value []byte) ([]byte, error)

TryEncryptValue will try to encrypt a byte array if the state store has associated encryption keys. The function will append the name of the key to the value for later extraction. If no encryption keys exist, the function will return the bytes unmodified.

Types

type Algorithm

type Algorithm string

type ComponentEncryptionKeys

type ComponentEncryptionKeys struct {
	Primary   Key
	Secondary Key
}

ComponentEncryptionKeys holds the encryption keys set for a component.

func ComponentEncryptionKey

func ComponentEncryptionKey(component v1alpha1.Component, secretStore secretstores.SecretStore) (ComponentEncryptionKeys, error)

ComponentEncryptionKey checks if a component definition contains an encryption key and extracts it using the supplied secret store.

type Key

type Key struct {
	Key  string
	Name string
	// contains filtered or unexported fields
}

Key holds the key to encrypt an arbitrary object.

Jump to

Keyboard shortcuts

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