age

package
v1.9.3-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: MIT Imports: 24 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

This section is empty.

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) ExportPublicKey added in v1.10.0

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

ExportPublicKey is not implemented

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 is TODO

func (*Age) FindRecipients

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

FindRecipients it TODO

func (*Age) Fingerprint

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

Fingerprint return the id

func (*Age) FormatKey

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

FormatKey is TODO

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) ImportPublicKey added in v1.10.0

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

ImportPublicKey is TODO

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 is TODO

func (*Age) ListRecipients

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

ListRecipients is TODO

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 TODO

func (*Age) RecipientIDs

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

RecipientIDs is TODO

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