keeper

package
v0.1.99 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package keeper defines the envelope-encryption contract implemented by the KMS connections (AWS KMS, GCP KMS, Azure Key Vault) and the local keeper. It is a leaf package so that connection and secret can share it without linking any cloud SDK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keeper

type Keeper interface {
	Encrypt(ctx context.Context, plaintext []byte) ([]byte, error)
	Decrypt(ctx context.Context, ciphertext []byte) ([]byte, error)
	Close() error
}

Keeper encrypts and decrypts small payloads such as secrets and connection credentials. Implementations return errors that name the backend and key.

type Local

type Local struct {
	// contains filtered or unexported fields
}

Local encrypts with NaCl secretbox under a 32-byte key. Its ciphertext is the random nonce followed by the sealed message, byte-compatible with gocloud.dev/secrets/localsecrets, so data written by the previous keeper still decrypts.

func NewLocal

func NewLocal(key [32]byte) *Local

NewLocal builds a Local keeper from raw 32-byte key material.

func NewLocalFromBase64

func NewLocalFromBase64(encoded string) (*Local, error)

NewLocalFromBase64 builds a Local keeper from a url-safe base64 32-byte key.

func (*Local) Close

func (l *Local) Close() error

func (*Local) Decrypt

func (l *Local) Decrypt(_ context.Context, ciphertext []byte) ([]byte, error)

func (*Local) Encrypt

func (l *Local) Encrypt(_ context.Context, plaintext []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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