age

package
v0.1.76 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKey

func GenerateKey(path string) error

GenerateKey generates a new age key at path. No-op if the file already exists.

func GenerateKeyForce added in v0.1.76

func GenerateKeyForce(path string) error

GenerateKeyForce generates a new age key at path, overwriting any existing file.

func PublicKeyFrom

func PublicKeyFrom(keyFile string) (string, error)

PublicKeyFrom reads the public key from an age key file.

Types

type AgeArmorDecryptor

type AgeArmorDecryptor struct {
	KeyFile string
}

AgeArmorDecryptor encrypts and decrypts .ward files as opaque age-armored blobs. The entire file is the ciphertext — no YAML structure is exposed.

func (AgeArmorDecryptor) Decrypt

func (d AgeArmorDecryptor) Decrypt(path string) ([]byte, error)

Decrypt returns the plaintext of path. Plain (unencrypted) files pass through as-is.

func (AgeArmorDecryptor) Encrypt

func (d AgeArmorDecryptor) Encrypt(path string, plaintext []byte) error

Encrypt encrypts plaintext with the key in KeyFile and writes the armored result to path.

Jump to

Keyboard shortcuts

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