keychain

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Rendered for darwin/amd64

Overview

Package keychain owns the user's macOS login keychain: one handle per run, opened on first use.

Index

Constants

This section is empty.

Variables

View Source
var ErrLocked = errors.New("login keychain is locked")

ErrLocked reports that no usable password was supplied, so the keychain yields metadata only.

Functions

This section is empty.

Types

type Keychain

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

func New

func New(path string, password PasswordFunc) *Keychain

New does no I/O, so building a handle never prompts; the first query opens the keychain.

func (*Keychain) Err

func (k *Keychain) Err() error

Err is why the keychain is locked or unreadable; nil when it is open or was never used.

func (*Keychain) GenericPassword

func (k *Keychain) GenericPassword(ctx context.Context, account string) ([]byte, error)

func (*Keychain) InternetPasswords

func (k *Keychain) InternetPasswords(ctx context.Context) ([]keychainbreaker.InternetPassword, error)

InternetPasswords leaves the secrets empty when the keychain is locked.

type PasswordFunc

type PasswordFunc func(ctx context.Context) (string, error)

PasswordFunc yields the login password; "" means none was supplied.

Jump to

Keyboard shortcuts

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