Documentation ¶
Overview ¶
Package yubikey provides Go bindings for libyubikey.
Index ¶
- Constants
- func AesDecrypt(state []byte, key string)
- func AesEncrypt(state []byte, key string)
- func Crc16(buf string, bufSize uint) uint16
- func Generate(token *Token, key *[16]byte, out *[32]byte)
- func HexDecode(dst []byte, src string, dstsize uint)
- func HexEncode(dst []byte, src string, srcsize uint)
- func HexP(str string) int32
- func ModhexDecode(dst []byte, src string, dstsize uint)
- func ModhexEncode(dst []byte, src string, srcsize uint)
- func ModhexP(str string) int32
- func Parse(token *[16]byte, key *[16]byte, out *Token)
- type Token
Constants ¶
const ( // BLOCKSIZE as defined in libyubikey/yubikey.h:44 BLOCKSIZE = 16 // KEYSIZE as defined in libyubikey/yubikey.h:45 KEYSIZE = 16 // UIDSIZE as defined in libyubikey/yubikey.h:46 UIDSIZE = 6 // OTPSIZE as defined in libyubikey/yubikey.h:47 OTPSIZE = (2 * BLOCKSIZE) // MODHEXMAP as defined in libyubikey/yubikey.h:94 MODHEXMAP = "cbdefghijklnrtuv" // CRCOKRESIDUE as defined in libyubikey/yubikey.h:122 CRCOKRESIDUE = 0xf0b8 )
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶
AesDecrypt function as declared in libyubikey/yubikey.h:129
func AesEncrypt ¶
AesEncrypt function as declared in libyubikey/yubikey.h:130
func ModhexDecode ¶
ModhexDecode function as declared in libyubikey/yubikey.h:106
func ModhexEncode ¶
ModhexEncode function as declared in libyubikey/yubikey.h:100
Types ¶
type Token ¶
type Token struct { Uid [6]byte Ctr uint16 Tstpl uint16 Tstph byte Use byte Rnd uint16 Crc uint16 // contains filtered or unexported fields }
Token as declared in libyubikey/yubikey.h:68
func NewTokenRef ¶
NewTokenRef creates a new wrapper struct with underlying reference set to the original C object. Returns nil if the provided pointer to C object is nil too.
func (*Token) Deref ¶
func (x *Token) Deref()
Deref uses the underlying reference to C object and fills the wrapping struct with values. Do not forget to call this method whether you get a struct for C object and want to read its values.
func (*Token) Free ¶
func (x *Token) Free()
Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. Does nothing if struct is nil or has no allocation map.
func (*Token) PassRef ¶
func (x *Token) PassRef() (*C.yubikey_token_st, *cgoAllocMap)
PassRef returns the underlying C object, otherwise it will allocate one and set its values from this wrapping struct, counting allocations into an allocation map.
func (Token) PassValue ¶
func (x Token) PassValue() (C.yubikey_token_st, *cgoAllocMap)
PassValue does the same as PassRef except that it will try to dereference the returned pointer.
func (*Token) Ref ¶
func (x *Token) Ref() *C.yubikey_token_st
Ref returns the underlying reference to C object or nil if struct is nil.