token

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

AllKeySpecs represents all the key specifications supported by this package.

View Source
var ErrNotReset = errors.New("security key already set up")

ErrNotReset is returned from Setup when the security key is already set up and reset is false.

Functions

func Get

func Get(card string) (*piv.YubiKey, error)

Get returns a security key identified by card string.

func Setup

func Setup(k *piv.YubiKey, pin, version string, reset, allTouchPolicies bool) error

Setup sets up the given security key / hardware token

Types

type KeySpec

type KeySpec struct {
	Slot        piv.Slot
	TouchPolicy piv.TouchPolicy
}

KeySpec represents the specification of a key on the token.

type SSHKeySpec

type SSHKeySpec struct {
	PubKey      ssh.PublicKey
	Slot        piv.Slot
	TouchPolicy piv.TouchPolicy
	Card        string
	Serial      uint32
}

SSHKeySpec represents an SSH key stored on a security key / hardware token.

func SSHKeySpecs

func SSHKeySpecs(sks []SecurityKey) ([]SSHKeySpec, error)

SSHKeySpecs returns all the SSHKeySpecs available on the given list of SecurityKeys.

type SecurityKey

type SecurityKey struct {
	Card   string
	Key    *piv.YubiKey
	Serial uint32
}

SecurityKey represents a security key / hardware token.

func List

func List(log *zap.Logger) ([]SecurityKey, error)

List returns all security keys available on the system.

Jump to

Keyboard shortcuts

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