libyubikey: github.com/jessfraz/libyubikey Index | Files

package yubikey

import "github.com/jessfraz/libyubikey"

Package yubikey provides Go bindings for libyubikey.

Index

Package Files

cgo_helpers.go const.go doc.go types.go yubikey.go

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
)

func AesDecrypt Uses

func AesDecrypt(state []byte, key string)

AesDecrypt function as declared in libyubikey/yubikey.h:129

func AesEncrypt Uses

func AesEncrypt(state []byte, key string)

AesEncrypt function as declared in libyubikey/yubikey.h:130

func Crc16 Uses

func Crc16(buf string, bufSize uint) uint16

Crc16 function as declared in libyubikey/yubikey.h:123

func Generate Uses

func Generate(token *Token, key *[16]byte, out *[32]byte)

Generate function as declared in libyubikey/yubikey.h:81

func HexDecode Uses

func HexDecode(dst []byte, src string, dstsize uint)

HexDecode function as declared in libyubikey/yubikey.h:111

func HexEncode Uses

func HexEncode(dst []byte, src string, srcsize uint)

HexEncode function as declared in libyubikey/yubikey.h:110

func HexP Uses

func HexP(str string) int32

HexP function as declared in libyubikey/yubikey.h:116

func ModhexDecode Uses

func ModhexDecode(dst []byte, src string, dstsize uint)

ModhexDecode function as declared in libyubikey/yubikey.h:106

func ModhexEncode Uses

func ModhexEncode(dst []byte, src string, srcsize uint)

ModhexEncode function as declared in libyubikey/yubikey.h:100

func ModhexP Uses

func ModhexP(str string) int32

ModhexP function as declared in libyubikey/yubikey.h:115

func Parse Uses

func Parse(token *[16]byte, key *[16]byte, out *Token)

Parse function as declared in libyubikey/yubikey.h:76

type Token Uses

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 Uses

func NewTokenRef(ref unsafe.Pointer) *Token

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (x *Token) Ref() *C.yubikey_token_st

Ref returns the underlying reference to C object or nil if struct is nil.

Package yubikey imports 3 packages (graph). Updated 2019-05-31. Refresh now. Tools for package owners.