secrets

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package secrets encrypts sensitive application settings with a deployment-managed key.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotConfigured = errors.New("application encryption key is not configured")

ErrNotConfigured indicates that no application encryption key is available.

Functions

func ParseKey added in v0.0.4

func ParseKey(value string) ([]byte, error)

ParseKey decodes an optional base64-encoded 256-bit encryption key.

func ValidateKey

func ValidateKey(value string) error

ValidateKey validates an optional base64-encoded 256-bit encryption key.

Types

type Cipher

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

Cipher encrypts and decrypts persisted application secrets.

func New

func New(value string) (*Cipher, error)

New constructs a cipher from an optional base64-encoded 256-bit key.

func (*Cipher) Configured

func (c *Cipher) Configured() bool

Configured reports whether this process can encrypt and decrypt application secrets.

func (*Cipher) Decrypt

func (c *Cipher) Decrypt(value string) (string, error)

Decrypt decrypts one versioned ciphertext value.

func (*Cipher) Encrypt

func (c *Cipher) Encrypt(value string) (string, error)

Encrypt encrypts one plaintext value with a fresh random nonce.

Jump to

Keyboard shortcuts

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