utils

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOpenSSHIdentities

func AddOpenSSHIdentities(identities *[]age.Identity)

func ErrorWithHint

func ErrorWithHint(error string, hints ...string)

func Errorf

func Errorf(format string, v ...interface{})

func IdentitiesToRecipients

func IdentitiesToRecipients(ids []age.Identity) ([]age.Recipient, error)

func LogFatalf

func LogFatalf(format string, v ...interface{})

func NewLazyOpener

func NewLazyOpener(name string, overwrite bool) io.WriteCloser

func ParseIdentitiesFile

func ParseIdentitiesFile(name string, stdinInUse bool) ([]age.Identity, error)

ParseIdentitiesFile parses a file that contains age or SSH keys. It returns one or more of *age.X25519Identity, *agessh.RSAIdentity, *agessh.Ed25519Identity, *agessh.EncryptedSSHIdentity, or *EncryptedIdentity.

func ParseRecipient

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

func ParseRecipientsFile

func ParseRecipientsFile(name string, stdinInUse bool) ([]age.Recipient, error)

func ParseSSHIdentity

func ParseSSHIdentity(name string, pemBytes []byte) ([]age.Identity, error)

func PassphrasePrompt

func PassphrasePrompt() (string, error)

func RandomWord

func RandomWord() string

func ReadPassphrase

func ReadPassphrase(prompt string) ([]byte, error)

ReadPassphrase reads a passphrase from the terminal. It does not read from a non-terminal stdin, so it does not check stdinInUse.

func Warningf

func Warningf(format string, v ...interface{})

Types

type EncryptedIdentity

type EncryptedIdentity struct {
	Contents       []byte
	Passphrase     func() (string, error)
	NoMatchWarning func()
	// contains filtered or unexported fields
}

func (*EncryptedIdentity) Recipients

func (i *EncryptedIdentity) Recipients() ([]age.Recipient, error)

func (*EncryptedIdentity) Unwrap

func (i *EncryptedIdentity) Unwrap(stanzas []*age.Stanza) (fileKey []byte, err error)

type GitHubRecipientError

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

func (GitHubRecipientError) Error

func (GitHubRecipientError) Error() string

func (GitHubRecipientError) Username

func (g GitHubRecipientError) Username() string

type LazyScryptIdentity

type LazyScryptIdentity struct {
	Passphrase func() (string, error)
}

func (*LazyScryptIdentity) Unwrap

func (i *LazyScryptIdentity) Unwrap(stanzas []*age.Stanza) (fileKey []byte, err error)

Jump to

Keyboard shortcuts

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