keychain

package
v3.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package keychain implements a native secure password store for each platform.

Index

Constants

View Source
const Version = "k11"

Version is the keychain data version.

View Source
const WindowsCredentials = "windows-credentials"

Variables

View Source
var (
	// ErrNoKeychain indicates that no suitable keychain implementation could be loaded.
	ErrNoKeychain = errors.New("no keychain") //nolint:gochecknoglobals

	// ErrMacKeychainRebuild is returned on macOS with blocked or corrupted keychain.
	ErrMacKeychainRebuild = errors.New("keychain error -25293")

	// Helpers holds all discovered keychain helpers. It is populated in init().
	Helpers map[string]helperConstructor //nolint:gochecknoglobals

)

Functions

This section is empty.

Types

type Keychain

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

func NewKeychain

func NewKeychain(preferred, keychainName string) (*Keychain, error)

NewKeychain creates a new native keychain.

func NewMissingKeychain

func NewMissingKeychain() *Keychain

NewMissingKeychain returns a new keychain that always returns an error.

func (*Keychain) Clear

func (kc *Keychain) Clear() error

func (*Keychain) Delete

func (kc *Keychain) Delete(userID string) error

func (*Keychain) Get

func (kc *Keychain) Get(userID string) (string, string, error)

Get returns the username and secret for the given userID.

func (*Keychain) List

func (kc *Keychain) List() ([]string, error)

func (*Keychain) Put

func (kc *Keychain) Put(userID, secret string) error

Jump to

Keyboard shortcuts

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