Documentation ¶
Index ¶
- Constants
- Variables
- func HasUseKeychain(ctx context.Context) bool
- func IsOnlyNative(ctx context.Context) bool
- func IsUseKeychain(ctx context.Context) bool
- func PassageIdFile() string
- func WithOnlyNative(ctx context.Context, at bool) context.Context
- func WithUseKeychain(ctx context.Context, bv bool) context.Context
- type Age
- func (a *Age) Concurrency() int
- func (a *Age) Decrypt(ctx context.Context, ciphertext []byte) ([]byte, error)
- func (a *Age) Encrypt(ctx context.Context, plaintext []byte, recipients []string) ([]byte, error)
- func (a *Age) Ext() string
- func (a *Age) FindIdentities(ctx context.Context, keys ...string) ([]string, error)
- func (a *Age) FindRecipients(ctx context.Context, search ...string) ([]string, error)
- func (a *Age) Fingerprint(ctx context.Context, id string) string
- func (a *Age) FormatKey(ctx context.Context, id, tpl string) string
- func (a *Age) GenerateIdentity(ctx context.Context, _ string, _ string, pw string) error
- func (a *Age) IDFile() string
- func (a *Age) Identities(ctx context.Context) ([]age.Identity, error)
- func (a *Age) IdentityRecipients(ctx context.Context) ([]age.Recipient, error)
- func (a *Age) Initialized(ctx context.Context) error
- func (a *Age) ListIdentities(ctx context.Context) ([]string, error)
- func (a *Age) ListRecipients(context.Context) ([]string, error)
- func (a *Age) Lock()
- func (a *Age) Name() string
- func (a *Age) ReadNamesFromKey(ctx context.Context, buf []byte) ([]string, error)
- func (a *Age) RecipientIDs(ctx context.Context, buf []byte) ([]string, error)
- func (a *Age) Version(ctx context.Context) semver.Version
- type Keypair
- type Keyring
Constants ¶
const ( // Ext is the file extension for age encrypted secrets. Ext = "age" // IDFile is the name for age recipients. IDFile = ".age-recipients" )
Variables ¶
var ( // OldIDFile is the old file name for the recipients. OldIDFile = ".age-ids" // OldKeyring is the old file name for the keyring. OldKeyring = filepath.Join(appdir.UserConfig(), "age-keyring.age") )
var ( // ErrNoSSHDir signals that no SSH dir was found. Callers // are usually expected to ignore this. ErrNoSSHDir = errors.New("no ssh directory") )
Functions ¶
func HasUseKeychain ¶ added in v1.14.8
HasUseKeychain returns true if a value for use keychain was set in the context.
func IsOnlyNative ¶ added in v1.14.0
IsOnlyNative will return the value of the only native flag or the default (false).
func IsUseKeychain ¶ added in v1.14.8
IsUseKeychain returns the value of use keychain.
func PassageIdFile ¶ added in v1.14.8
func PassageIdFile() string
PassageIdFile returns the location of the passage identities file.
func WithOnlyNative ¶ added in v1.14.0
WithOnlyNative will return a context with the flag for only native set.
Types ¶
type Age ¶
type Age struct {
// contains filtered or unexported fields
}
Age is an age backend.
func (*Age) Concurrency ¶ added in v1.13.0
Concurrency returns the number of CPUs.
func (*Age) FindIdentities ¶
FindIdentities returns all usable identities (native only).
func (*Age) FindRecipients ¶
FindRecipients returns all list of usable recipient key IDs matching the search strings. For native age keys this is a no-op since they are self-contained (i.e. the ID is the full key already). But for SSH keys, especially GitHub indirections, an extra step is necessary.
func (*Age) Fingerprint ¶
Fingerprint returns the id.
func (*Age) GenerateIdentity ¶
GenerateIdentity creates a new identity.
func (*Age) Identities ¶ added in v1.14.0
Identities returns all identities, used for decryption.
func (*Age) IdentityRecipients ¶ added in v1.14.0
IdentityRecipients returns a slice of recipients dervied from our identities. Since the identity file is encrypted we try to use a cached copy of the recipients dervied from the identities.
func (*Age) Initialized ¶
Initialized returns nil.
func (*Age) ListIdentities ¶
ListIdentities lists all identities.
func (*Age) ListRecipients ¶
ListRecipients is not supported for the age backend.
func (*Age) ReadNamesFromKey ¶
ReadNamesFromKey is not supported for the age backend.
func (*Age) RecipientIDs ¶
RecipientIDs is not supported for the age backend.