age

package
v0.0.0-...-4fbe4fe Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Config *Config
	Stderr io.Writer // Diagnostic output writer (default: os.Stderr)
}

Backend object

func NewAgeBackend

func NewAgeBackend(config map[string]any) (backend *Backend)

NewAgeBackend instantiate a new Age Backend from config map passed as argument

func (*Backend) Comments

func (ab *Backend) Comments() string

Comments implementation for Age Backend

func (*Backend) Configure

func (ab *Backend) Configure(arguments map[string]any) (err error)

Configure implementation for Age Backend

func (*Backend) Encrypt

func (ab *Backend) Encrypt(in io.Reader) (out io.Reader, err error)

Encrypt implementation for Age Backend

func (*Backend) GetConfiguration

func (ab *Backend) GetConfiguration() any

GetConfiguration implementation for Age Backend

func (*Backend) SetStderr

func (ab *Backend) SetStderr(w io.Writer)

SetStderr sets the writer for diagnostic output.

type Config

type Config struct {
	// --- User-configurable (via [SecureOptions] or CLI flags) ---
	Passphrase string // Encryption passphrase; auto-generated if both Passphrase and Recipient are empty
	Recipient  string // Recipient: @github_user, ssh://host, URL, ssh public key, or native age1… key

	// --- Runtime state (not configurable via .plikrc) ---
	Yes         bool            // Auto-accept confirmation prompts (from --yes flag)
	Recipients  []age.Recipient `json:"-"` // Resolved age.Recipient objects; set during Configure()
	DecryptHint string          `json:"-"` // Decrypt command hint for Comments(); set during Configure()
}

Config for the age crypto backend.

User-facing fields (configurable via [SecureOptions] in .plikrc or CLI flags):

  • Passphrase: symmetric encryption passphrase (auto-generated if omitted)
  • Recipient: asymmetric recipient (@github_user, ssh://host, URL, ssh key, or age1…)

Passphrase and Recipient are mutually exclusive.

func NewAgeBackendConfig

func NewAgeBackendConfig(params map[string]any) (config *Config)

NewAgeBackendConfig instantiate a new Backend Configuration from config map passed as argument

Jump to

Keyboard shortcuts

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