keychain

package
v0.0.0-...-af9f243 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const WaspCliServiceName = "IOTAFoundation.WaspCLI"

Variables

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

	ErrTokenDoesNotExist      = errors.New("jwt token not found, call 'login'")
	ErrPasswordDoesNotExist   = errors.New("stronghold entry not found, call 'init'")
	ErrSeedDoesNotExist       = errors.New("seed not found, call 'init'")
	ErrSeedDoesNotMatchLength = errors.New("returned seed does not have a valid length")
)
View Source
var ErrInvalidPassword = errors.New("invalid password")

Functions

func IsKeyChainAvailable

func IsKeyChainAvailable() bool

IsKeyChainAvailable validates existence of a keychain by querying an entry. If a keychain is not available, it will throw an internal OS error, while an existing keychain will return ErrNotFound (as the key does not exist)

Types

type KeyChain

type KeyChain interface {
	SetSeed(seed cryptolib.Seed) error
	GetSeed() (*cryptolib.Seed, error)

	SetStrongholdPassword(password *memguard.Enclave) error
	GetStrongholdPassword() (*memguard.Enclave, error)

	SetJWTAuthToken(node string, token string) error
	GetJWTAuthToken(node string) (string, error)
}

type KeyChain99

type KeyChain99 struct {
	Keyring keyring.Keyring
}

func NewKeyRing99

func NewKeyRing99(baseDir string) *KeyChain99

func (*KeyChain99) Close

func (k *KeyChain99) Close()

func (*KeyChain99) GetJWTAuthToken

func (k *KeyChain99) GetJWTAuthToken(node string) (string, error)

func (*KeyChain99) GetSeed

func (k *KeyChain99) GetSeed() (*cryptolib.Seed, error)

func (*KeyChain99) GetStrongholdPassword

func (k *KeyChain99) GetStrongholdPassword() (*memguard.Enclave, error)

func (*KeyChain99) SetJWTAuthToken

func (k *KeyChain99) SetJWTAuthToken(node string, token string) error

func (*KeyChain99) SetSeed

func (k *KeyChain99) SetSeed(seed cryptolib.Seed) error

func (*KeyChain99) SetStrongholdPassword

func (k *KeyChain99) SetStrongholdPassword(password *memguard.Enclave) error

type KeyChainFile

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

func NewKeyChainFile

func NewKeyChainFile(path string, passwordCallback func() *memguard.Enclave) *KeyChainFile

func (*KeyChainFile) FilePath

func (k *KeyChainFile) FilePath() string

func (*KeyChainFile) Get

func (k *KeyChainFile) Get(key string) ([]byte, error)

func (*KeyChainFile) GetJWTAuthToken

func (k *KeyChainFile) GetJWTAuthToken(node string) (string, error)

func (*KeyChainFile) GetSeed

func (k *KeyChainFile) GetSeed() (*cryptolib.Seed, error)

func (*KeyChainFile) GetStrongholdPassword

func (k *KeyChainFile) GetStrongholdPassword() (*memguard.Enclave, error)

func (*KeyChainFile) ReadContents

func (k *KeyChainFile) ReadContents() (map[string][]byte, error)

func (*KeyChainFile) Set

func (k *KeyChainFile) Set(key string, value []byte) error

func (*KeyChainFile) SetJWTAuthToken

func (k *KeyChainFile) SetJWTAuthToken(node string, token string) error

func (*KeyChainFile) SetSeed

func (k *KeyChainFile) SetSeed(seed cryptolib.Seed) error

func (*KeyChainFile) SetStrongholdPassword

func (k *KeyChainFile) SetStrongholdPassword(password *memguard.Enclave) error

type KeyChainZalando

type KeyChainZalando struct{}

func NewKeyChainZalando

func NewKeyChainZalando() *KeyChainZalando

func (*KeyChainZalando) GetJWTAuthToken

func (k *KeyChainZalando) GetJWTAuthToken(node string) (string, error)

func (*KeyChainZalando) GetSeed

func (k *KeyChainZalando) GetSeed() (*cryptolib.Seed, error)

func (*KeyChainZalando) GetStrongholdPassword

func (k *KeyChainZalando) GetStrongholdPassword() (*memguard.Enclave, error)

func (*KeyChainZalando) SetJWTAuthToken

func (k *KeyChainZalando) SetJWTAuthToken(node string, token string) error

func (*KeyChainZalando) SetSeed

func (k *KeyChainZalando) SetSeed(seed cryptolib.Seed) error

func (*KeyChainZalando) SetStrongholdPassword

func (k *KeyChainZalando) SetStrongholdPassword(password *memguard.Enclave) error

Jump to

Keyboard shortcuts

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