keystore

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package keystore provides an interface to the GNOME Keyring via the Secret Service D-Bus API using native D-Bus communication.

Index

Constants

View Source
const (
	// AttributeKeyApplication is the attribute that identity the type of keys
	// in the keystore.
	AttributeKeyApplication = "age-plugin-keystore"
	// AttributeKeyID is the attribute name used to identify keys.
	AttributeKeyID = "age-keystore-id"

	// D-Bus constants for Secret Service API
	SecretServiceName           = "org.freedesktop.secrets"
	ObjectPathService           = "/org/freedesktop/secrets"
	ObjectPathDefaultCollection = "/org/freedesktop/secrets/aliases/default"

	// D-Bus constants for Secret Service Errors
	SecretErrorIsLocked = "org.freedesktop.Secret.Error.IsLocked"
)

Variables

View Source
var ErrKeyNotFound = errors.New("key not found in keystore")

ErrKeyNotFound is returned when a key is not found in the keystore.

View Source
var ErrSecretEmpty = errors.New("Secret is empty")

Functions

This section is empty.

Types

type Attributes added in v1.2.0

type Attributes map[string]string

type Item added in v1.2.0

type Item dbus.ObjectPath

type Items added in v1.2.0

type Items []dbus.ObjectPath

type Keystore added in v1.2.0

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

func New added in v1.2.0

func New() Keystore

func (*Keystore) Close added in v1.2.0

func (k *Keystore) Close() error

func (Keystore) Delete added in v1.2.0

func (k Keystore) Delete(keyID string) error

Delete removes a secret key from the keyring. Returns ErrKeyNotFound if the key does not exist.

func (Keystore) List added in v1.2.0

func (k Keystore) List() ([]string, error)

List returns all key IDs stored in the keyring.

func (Keystore) Lookup added in v1.2.0

func (k Keystore) Lookup(keyID string) (string, error)

Lookup retrieves a secret key from the keyring.

func (*Keystore) Obj added in v1.2.0

func (k *Keystore) Obj(path dbus.ObjectPath) dbus.BusObject

func (*Keystore) Signal added in v1.2.0

func (k *Keystore) Signal() chan *dbus.Signal

func (Keystore) Store added in v1.2.0

func (k Keystore) Store(secretKey string) (string, error)

Store stores a secret key in the keyring. It returns a keyID that is used to identify the key for later retrieval.

type Prompt added in v1.2.0

type Prompt dbus.ObjectPath

type Secret added in v1.2.0

type Secret struct {
	Session     dbus.ObjectPath
	Parameters  []byte
	Value       []byte
	ContentType string
}

Secret represents the Secret structure used by the Secret Service API.

type Secrets added in v1.2.0

type Secrets map[dbus.ObjectPath]Secret

type Session added in v1.2.0

type Session struct {
	Path dbus.ObjectPath
	// contains filtered or unexported fields
}

type SessionAlgo added in v1.2.0

type SessionAlgo string
const (
	SessionAlgoPlain SessionAlgo = "plain"
	SessionAlgoDH    SessionAlgo = "dh-ietf1024-sha256-aes128-cbc-pkcs7"
)

Session Algo modes used when opening sessions

Jump to

Keyboard shortcuts

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