age

package
v1.12.5 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2021 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Ext is the file extension for age encrypted secrets
	Ext = "age"
	// IDFile is the name for age recipients
	IDFile = ".age-ids"
)

Variables

View Source
var (
	// DefaultAskPass is the default password cache
	DefaultAskPass = newAskPass()
)

Functions

This section is empty.

Types

type Age

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

Age is an age backend

func New

func New() (*Age, error)

New creates a new Age backend

func (*Age) Decrypt

func (a *Age) Decrypt(ctx context.Context, ciphertext []byte) ([]byte, error)

Decrypt will attempt to decrypt the given payload

func (*Age) Encrypt

func (a *Age) Encrypt(ctx context.Context, plaintext []byte, recipients []string) ([]byte, error)

Encrypt will encrypt the given payload

func (*Age) Ext

func (a *Age) Ext() string

Ext returns the extension

func (*Age) FindIdentities

func (a *Age) FindIdentities(ctx context.Context, keys ...string) ([]string, error)

FindIdentities returns all usable identities (SSH and native)

func (*Age) FindRecipients

func (a *Age) FindRecipients(ctx context.Context, keys ...string) ([]string, error)

FindRecipients is TODO

func (*Age) Fingerprint

func (a *Age) Fingerprint(ctx context.Context, id string) string

Fingerprint returns the id

func (*Age) FormatKey

func (a *Age) FormatKey(ctx context.Context, id, tpl string) string

FormatKey returns the key id

func (*Age) GenerateIdentity

func (a *Age) GenerateIdentity(ctx context.Context, name, email, _ string) error

GenerateIdentity will create a new native private key

func (*Age) IDFile

func (a *Age) IDFile() string

IDFile return the recipients file

func (*Age) Initialized

func (a *Age) Initialized(ctx context.Context) error

Initialized returns nil

func (*Age) ListIdentities

func (a *Age) ListIdentities(ctx context.Context) ([]string, error)

ListIdentities lists all identities

func (*Age) ListRecipients

func (a *Age) ListRecipients(context.Context) ([]string, error)

ListRecipients is not supported for the age backend

func (*Age) Lock added in v1.12.0

func (a *Age) Lock()

Lock flushes the password cache

func (*Age) Name

func (a *Age) Name() string

Name returns age

func (*Age) ReadNamesFromKey

func (a *Age) ReadNamesFromKey(ctx context.Context, buf []byte) ([]string, error)

ReadNamesFromKey is not supported for the age backend

func (*Age) RecipientIDs

func (a *Age) RecipientIDs(ctx context.Context, buf []byte) ([]string, error)

RecipientIDs is not supported for the age backend

func (*Age) Version

func (a *Age) Version(ctx context.Context) semver.Version

Version return 1.0.0

type Keypair

type Keypair struct {
	Name     string `json:"name"`
	Email    string `json:"email"`
	Identity string `json:"identity"`
}

Keypair is a public / private keypair

type Keyring

type Keyring []Keypair

Keyring is an age keyring

Jump to

Keyboard shortcuts

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