Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Data ¶
type Data []byte
Data is a functional wrapper around a byte slice providing various feature not found in the standard library
func Encode ¶
Encode is an opiniated Base64 encoder function using a strict variant of base64.RawStdEncoding for data processing
type Encrypter ¶
Encrypter is a processing contract for data in- and output. It is up to the implementation to decide if they can consume their own output multiple times.
type EncrypterPlugin ¶
type EncrypterPlugin interface { // Encrypter is an identification method. The return value is // expected to be stable over multiple invocations. Encrypter() string // NewEncrypter is a factory method. The input parameter // is a directory for potential data persistence, which might not exist. NewEncrypter(string) (Encrypter, error) }
EncrypterPlugin is a factory contract for encryption systems.
type Encrypters ¶
Encrypters is a map implementation with convenience functions
func (Encrypters) Add ¶
func (e Encrypters) Add(provider string, impl Encrypter) bool
Add stores the given encrypter implementation under the given key. Keys can only be used once and return false on collisions. The storage key is sanitized for unambiguous access later on.
func (Encrypters) Get ¶
func (e Encrypters) Get(provider string) (Encrypter, bool)
Get retrieves a previously stored encrypter implementation using the given key as lookup. If no instance is available, false is returned.
func (Encrypters) Providers ¶
func (e Encrypters) Providers() []string
Providers returns all the keys of the map.
type SecretsGenerator ¶
type SecretsGenerator interface { // GenerateSecrets is used to create any configuration, secrets, or otherwise // persistent data for later de-/encryption. If the first parameter is true, // any existing data is expected to be overwritten. The given context contains // additional utilities. GenerateSecrets(bool, context.Context) error }
SecretsGenerator is implemented by encryption plugins which utilize some kind of persistent information during processing.