Versions in this module Expand all Collapse all v1 v1.3.1 Nov 10, 2019 Changes in this version + const PinPolicyAlways + const PinPolicyNever + const PinPolicyNull + const PinPolicyOnce + const TouchPolicyAlways + const TouchPolicyCached + const TouchPolicyNever + const TouchPolicyNull + var AlgorithmError = Error + var AppletError = Error + var AuthBlocked = Error + var AuthenticationError = Error + var GenericError = Error + var IncorrectParam = Error + var IncorrectSlot = Error + var InvalidObject = Error + var KeyError = Error + var MemoryError = Error + var PCSCError = Error + var PINLockedError = Error + var ParseError = Error + var RandomnessError = Error + var SecurityStatusError = Error + var SizeError = Error + var WrongPIN = Error + func Readers() ([]string, error) + func VerifyAttestation(attestationCert, attestedCert *x509.Certificate) ([][]*x509.Certificate, error) + type AttestionCertificate struct + FirmwareVersion *[3]byte + PinPolicy *byte + SerialNumber *int + TouchPolicy *byte + func NewAttestionCertificate(cert *x509.Certificate) (*AttestionCertificate, error) + type Error struct + Code int + Message string + func (e Error) Equal(err error) bool + func (e Error) Error() string + type Options struct + ManagementKey []byte + ManagementKeyIsPIN bool + PIN *string + PUK *string + Reader string + Verbose bool + func (o Options) GetManagementKey(y Yubikey) ([]byte, error) + func (o Options) GetPIN() (string, error) + func (o Options) GetPUK() (string, error) + type PinPolicy byte + type Slot struct + Certificate *x509.Certificate + Id SlotId + PublicKey crypto.PublicKey + func (s Slot) Decrypt(rand io.Reader, msg []byte, opts crypto.DecrypterOpts) ([]byte, error) + func (s Slot) Public() crypto.PublicKey + func (s Slot) Sign(_ io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error) + func (slot Slot) TLSCertificate() tls.Certificate + func (y *Slot) Update(cert x509.Certificate) error + func (y Slot) Attest() (*x509.Certificate, error) + func (y Slot) GetCertificate() (*x509.Certificate, error) + type SlotId struct + Certificate int32 + Key int32 + Name string + var Attestation SlotId = SlotId{ ... } + var Authentication SlotId = SlotId{ ... } + var CardAuthentication SlotId = SlotId{ ... } + var KeyManagement SlotId = SlotId{ ... } + var Signature SlotId = SlotId{ ... } + func (s SlotId) String() string + type TouchPolicy byte + type Yubikey struct + func New(opts Options) (*Yubikey, error) + func (y Yubikey) Attest(slotId SlotId) (*x509.Certificate, error) + func (y Yubikey) Authenticate() error + func (y Yubikey) Authentication() (*Slot, error) + func (y Yubikey) CardAuthentication() (*Slot, error) + func (y Yubikey) ChangePIN(oldPin, newPin string) error + func (y Yubikey) ChangePUK(newPuk string) error + func (y Yubikey) Close() error + func (y Yubikey) GenerateEC(slot SlotId, bits int) (*Slot, error) + func (y Yubikey) GenerateECWithPolicies(slot SlotId, bits int, pinPolicy PinPolicy, touchPolicy TouchPolicy) (*Slot, error) + func (y Yubikey) GenerateRSA(id SlotId, bits int) (*Slot, error) + func (y Yubikey) GenerateRSAWithPolicies(id SlotId, bits int, pinPolicy PinPolicy, touchPolicy TouchPolicy) (*Slot, error) + func (y Yubikey) GetCertificate(slotId SlotId) (*x509.Certificate, error) + func (y Yubikey) GetObject(id int) ([]byte, error) + func (y Yubikey) ImportKey(slotID SlotId, privKey crypto.PrivateKey) (*Slot, error) + func (y Yubikey) KeyManagement() (*Slot, error) + func (y Yubikey) Login() error + func (y Yubikey) PINRetries() (int, error) + func (y Yubikey) Reset() error + func (y Yubikey) SaveCertificate(slotId SlotId, cert x509.Certificate) error + func (y Yubikey) SaveObject(id int32, data []byte) error + func (y Yubikey) Serial() (uint32, error) + func (y Yubikey) SetMGMKey(key []byte) error + func (y Yubikey) Signature() (*Slot, error) + func (y Yubikey) Slot(id SlotId) (*Slot, error) + func (y Yubikey) UnblockPIN(newPin string) error + func (y Yubikey) Version() ([]byte, error)