Documentation ¶
Index ¶
- Variables
- func SetLogger(l Logger) func()
- func Transact(db *sqlx.DB, txFn func(*sqlx.Tx) error) (err error)
- type Config
- func (c Config) Bytes(k string) ([]byte, error)
- func (c Config) KID(k string) (keys.ID, error)
- func (c Config) Set(k string, v string) error
- func (c Config) SetBytes(k string, v []byte) error
- func (c Config) SetKID(k string, v keys.ID) error
- func (c Config) SetString(k string, v string) error
- func (c Config) String(k string) (string, error)
- type Keyring
- func (k *Keyring) Auth() *auth.DB
- func (k *Keyring) Config() Config
- func (k *Keyring) DB() *sqlx.DB
- func (k *Keyring) FIDO2Devices(ctx context.Context) ([]*fido2.Device, error)
- func (k *Keyring) FIDO2Plugin() fido2.FIDO2Server
- func (k *Keyring) GenerateFIDO2HMACSecret(ctx context.Context, pin string, device string, appName string) (*auth.FIDO2HMACSecret, error)
- func (k *Keyring) Get(kid keys.ID) (*api.Key, error)
- func (k *Keyring) Key(kid keys.ID) (*api.Key, error)
- func (k *Keyring) KeyWithLabel(label string) (*api.Key, error)
- func (k *Keyring) Keys() ([]*api.Key, error)
- func (k *Keyring) KeysWithLabel(label string) ([]*api.Key, error)
- func (k *Keyring) KeysWithType(typ string) ([]*api.Key, error)
- func (k *Keyring) Lock() error
- func (k *Keyring) RegisterFIDO2HMACSecret(ctx context.Context, mk *[32]byte, hs *auth.FIDO2HMACSecret, pin string) (*auth.Auth, error)
- func (k *Keyring) RegisterPaperKey(mk *[32]byte, paperKey string) (*auth.Auth, error)
- func (k *Keyring) RegisterPassword(mk *[32]byte, password string) (*auth.Auth, error)
- func (k *Keyring) Remove(kid keys.ID) error
- func (k *Keyring) Reset() error
- func (k *Keyring) Set(key *api.Key) error
- func (k *Keyring) SetFIDO2Plugin(fido2Plugin fido2.FIDO2Server)
- func (k *Keyring) Setup(mk *[32]byte) error
- func (k *Keyring) SetupFIDO2HMACSecret(ctx context.Context, hs *auth.FIDO2HMACSecret, pin string) (*[32]byte, error)
- func (k *Keyring) SetupPaperKey(paperKey string) (*[32]byte, error)
- func (k *Keyring) SetupPassword(password string) (*[32]byte, error)
- func (k *Keyring) Status() Status
- func (k *Keyring) Unlock(mk *[32]byte) error
- func (k *Keyring) UnlockWithFIDO2HMACSecret(ctx context.Context, pin string) (*[32]byte, error)
- func (k *Keyring) UnlockWithPaperKey(paperKey string) (*[32]byte, error)
- func (k *Keyring) UnlockWithPassword(password string) (*[32]byte, error)
- type LogLevel
- type Logger
- type Status
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidAuth = auth.ErrInvalidAuth
ErrInvalidAuth if auth is invalid.
var ErrLocked = errors.New("keyring is locked")
ErrLocked if locked.
var ErrSetupNeeded = errors.New("setup needed")
ErrSetupNeeded if setup if needed.
Functions ¶
Types ¶
type Keyring ¶
type Keyring struct {
// contains filtered or unexported fields
}
Keyring stores secrets.
func (*Keyring) FIDO2Devices ¶
FIDO2Devices lists FIDO2 devices.
func (*Keyring) GenerateFIDO2HMACSecret ¶
func (k *Keyring) GenerateFIDO2HMACSecret(ctx context.Context, pin string, device string, appName string) (*auth.FIDO2HMACSecret, error)
GenerateFIDO2HMACSecret ...
func (*Keyring) KeyWithLabel ¶
KeyWithLabel in vault.
func (*Keyring) KeysWithLabel ¶
KeysWithLabel in vault.
func (*Keyring) KeysWithType ¶
KeysWithType in vault.
func (*Keyring) RegisterFIDO2HMACSecret ¶
func (k *Keyring) RegisterFIDO2HMACSecret(ctx context.Context, mk *[32]byte, hs *auth.FIDO2HMACSecret, pin string) (*auth.Auth, error)
RegisterFIDO2HMACSecret adds vault with a FIDO2 hmac-secret. Requires recent Unlock.
func (*Keyring) RegisterPaperKey ¶
RegisterPaperKey adds a paper key.
func (*Keyring) RegisterPassword ¶
RegisterPassword adds a password.
func (*Keyring) SetFIDO2Plugin ¶
func (k *Keyring) SetFIDO2Plugin(fido2Plugin fido2.FIDO2Server)
SetFIDO2Plugin sets the plugin.
func (*Keyring) SetupFIDO2HMACSecret ¶
func (k *Keyring) SetupFIDO2HMACSecret(ctx context.Context, hs *auth.FIDO2HMACSecret, pin string) (*[32]byte, error)
SetupFIDO2HMACSecret sets up vault with a FIDO2 hmac-secret.
func (*Keyring) SetupPaperKey ¶
SetupPaperKey setup vault with a paper key.
func (*Keyring) SetupPassword ¶
SetupPassword setup vault with a password.
func (*Keyring) UnlockWithFIDO2HMACSecret ¶
UnlockWithFIDO2HMACSecret opens vault with a FIDO2 hmac-secret.
func (*Keyring) UnlockWithPaperKey ¶
UnlockWithPaperKey opens vault with a paper key.