model

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 19 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 CreateFile added in v0.3.0

func CreateFile(recipients []string, entries []Entry, now time.Time) ([]byte, error)

func EnvStrings

func EnvStrings(entries []Entry) []string

func HasKey

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

func ReadCiphertext

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

func ValidateKey

func ValidateKey(name string) error

func WriteBootstrap added in v0.3.0

func WriteBootstrap(root, recipient string, sf SecretFile, entries []Entry, now time.Time) error

func WriteCiphertext

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

func WriteDefaultConfig added in v0.3.0

func WriteDefaultConfig(root, recipient string) (string, error)

func WriteNewFile added in v0.3.0

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

Types

type Entry

type Entry struct {
	Key   string
	Value string
}

type Identity added in v0.3.0

type Identity struct {
	Secret    string
	Recipient string
}

func GenerateIdentity added in v0.3.0

func GenerateIdentity() (Identity, error)

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

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

func (*Keyring) Unlock

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

type NewFilePlan added in v0.3.0

type NewFilePlan struct {
	File       SecretFile
	Recipients []string
	Bootstrap  bool
}

func PlanNewFile added in v0.3.0

func PlanNewFile(root, name string) (NewFilePlan, 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