Documentation ¶
Index ¶
- Variables
- func GenerateManagementKey() ([24]byte, error)
- func GeneratePinCode() (string, error)
- func GeneratePukCode() (string, error)
- func MapPINPolicy(name string) (piv.PINPolicy, bool)
- func MapToStrPINPolicy(policy piv.PINPolicy) (string, bool)
- func MapToStrTouchPolicy(policy piv.TouchPolicy) (string, bool)
- func MapTouchPolicy(name string) (piv.TouchPolicy, bool)
- func ValidatePin(pin string) bool
- func ValidatePuk(puk string) bool
- type Card
- type Cert
- type CertRequest
- type Slot
- type Yubikey
- func (y *Yubikey) Close() error
- func (y *Yubikey) GenCertificate(slot Slot, pin string, req CertRequest) (*x509.Certificate, error)
- func (y *Yubikey) GetActiveSlots(slots ...Slot) ([]Slot, error)
- func (y *Yubikey) GetCertPublicKey(slot piv.Slot) (crypto.PublicKey, error)
- func (y *Yubikey) ListKeys(slots ...Slot) ([]Cert, error)
- func (y *Yubikey) PrivateKey(slot piv.Slot, public crypto.PublicKey, auth piv.KeyAuth) (crypto.PrivateKey, error)
- func (y *Yubikey) Reset(newPIN, newPUK string) error
- func (y *Yubikey) ResetMngmtKey(newKey [24]byte) error
- func (y *Yubikey) ResetToDefault() error
- func (y *Yubikey) Retries() (int, error)
- func (y *Yubikey) SetPIN(currentPIN, newPIN string) error
- func (y *Yubikey) SetPUK(currentPUK, newPUK string) error
- func (y *Yubikey) Unblock(pukCode, newPIN string) error
- func (y *Yubikey) VerifyPIN(pin string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrYubikeyNotOpen = errors.New("yubikey not opened") )
View Source
var ( SlotKeyRSAID = uint32(0x95) SlotKeyECDSAID = uint32(0x94) SlotKeyRSA = MustSlotFromKeyID(SlotKeyRSAID) SlotKeyECDSA = MustSlotFromKeyID(SlotKeyECDSAID) AllSSHSlots = []Slot{ SlotKeyRSA, SlotKeyECDSA, } AllSlots = func() []Slot { out := []Slot{ MustSlotFromKeyID(piv.SlotAuthentication.Key), MustSlotFromKeyID(piv.SlotSignature.Key), MustSlotFromKeyID(piv.SlotKeyManagement.Key), MustSlotFromKeyID(piv.SlotCardAuthentication.Key), } for id := uint32(0x82); id <= 0x95; id++ { out = append(out, MustSlotFromKeyID(id)) } return out }() )
Functions ¶
func GenerateManagementKey ¶
func GeneratePinCode ¶
func GeneratePukCode ¶
func MapToStrTouchPolicy ¶
func MapToStrTouchPolicy(policy piv.TouchPolicy) (string, bool)
func MapTouchPolicy ¶
func MapTouchPolicy(name string) (piv.TouchPolicy, bool)
func ValidatePin ¶
func ValidatePuk ¶
Types ¶
type Cert ¶
type Cert struct { *x509.Certificate Slot Slot }
type Yubikey ¶
type Yubikey struct { Serial uint32 // contains filtered or unexported fields }
func OpenBySerial ¶
func (*Yubikey) GenCertificate ¶
func (y *Yubikey) GenCertificate(slot Slot, pin string, req CertRequest) (*x509.Certificate, error)
func (*Yubikey) GetCertPublicKey ¶
func (*Yubikey) PrivateKey ¶
func (*Yubikey) ResetMngmtKey ¶
func (*Yubikey) ResetToDefault ¶
Click to show internal directories.
Click to hide internal directories.