age

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 8 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(ciphertext []byte, identities ...age.Identity) ([]byte, error)

func EncryptForPublicKeys

func EncryptForPublicKeys(plaintext []byte, publicKeys []string) ([]byte, error)

EncryptForPublicKeys encrypts plaintext for every recipient. When every recipient is post-quantum, age keeps the file post-quantum: a classical recipient cannot be added to it. A mixed set is encrypted as classical, because one classical stanza is enough to recover the file key; see PostQuantum.

func Fingerprint

func Fingerprint(pubKey string) string

func IsPostQuantum

func IsPostQuantum(s string) bool

IsPostQuantum reports whether s is a hybrid recipient whose stanza stays confidential against a quantum computer.

func ParseRecipient

func ParseRecipient(s string) (age.Recipient, error)

ParseRecipient accepts the standard X25519, tagged P-256, hybrid ML-KEM-768 + X25519 and tagged hybrid ML-KEM-768 + P-256 age encodings.

func PostQuantum

func PostQuantum(recipients []string) bool

PostQuantum reports whether a file encrypted for recipients would be post-quantum: every recipient must be, since any classical stanza unwraps the same file key.

func RecipientKind

func RecipientKind(s string) string

RecipientKind names the key type of a recipient for display.

Types

type HybridKeyPair

type HybridKeyPair struct {
	Identity  *age.HybridIdentity
	PublicKey string
}

func GenerateHybridKeyPair

func GenerateHybridKeyPair() (*HybridKeyPair, error)

GenerateHybridKeyPair generates an ML-KEM-768 + X25519 (X-Wing) identity.

type KeyPair

type KeyPair struct {
	Identity  *age.X25519Identity
	PublicKey string
}

func GenerateKeyPair

func GenerateKeyPair() (*KeyPair, error)

Jump to

Keyboard shortcuts

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