model

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNeedUnlock = errors.New("no age identity in the keyring can decrypt this file")

Functions

func EnvStrings added in v0.2.0

func EnvStrings(entries []Entry) []string

func HasKey added in v0.2.0

func HasKey(entries []Entry, name string) bool

func ReadCiphertext

func ReadCiphertext(root string, sf SecretFile) ([]byte, error)

func ValidateKey added in v0.2.0

func ValidateKey(name string) error

func WriteCiphertext added in v0.2.0

func WriteCiphertext(root string, sf SecretFile, data []byte) error

Types

type Entry

type Entry struct {
	Key   string
	Value string
}

type Keyring

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

func NewKeyring

func NewKeyring() *Keyring

func (*Keyring) DecryptFile

func (k *Keyring) DecryptFile(ciphertext []byte) ([]Entry, error)

func (*Keyring) Empty

func (k *Keyring) Empty() bool

func (*Keyring) EncryptFile added in v0.2.0

func (k *Keyring) EncryptFile(ciphertext []byte, entries []Entry, now time.Time) ([]byte, error)

func (*Keyring) Unlock

func (k *Keyring) Unlock(secret string) error

type SecretFile

type SecretFile struct {
	Abs string
	Rel string
}

func DiscoverSecretFiles

func DiscoverSecretFiles(root string) ([]SecretFile, error)

Jump to

Keyboard shortcuts

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