Go bindings for ykpiv so you can write Go to interact with your yubikeys.

Clone this repo:

Branches

  1. 7947634 jfrazelle -> jessfraz by Jess Frazelle · 10 months ago master
  2. 12739d5 rm by Jess Frazelle · 10 months ago
  3. 331ef48 gen by Jess Frazelle · 10 months ago
  4. 1f7a8b5 travis by Jess Frazelle · 10 months ago
  5. 2b0bc86 init commit by Jess Frazelle · 10 months ago

ykpiv

GoDoc Travis CI

Go bindings for ykpiv so you can write Go to interact with your yubikeys. The C library lives at yubico/yubico-piv-tool.

C Libraries Required for Compilation

Example

package main

import (
	"fmt"
	"log"

	"github.com/jessfraz/ykpiv"
)

func main() {
	s := ykpiv.NewState()
	defer s.Free()

	// Let's get the readers
	readers := make([]byte, 2048)
	len := []uint{2048}
	log.Println("list")
	err := ykpiv.ListReaders([]ykpiv.State{*s}, readers, len)
	if err != 0 {
		log.Fatalf("%s: %#v", ykpiv.Strerror(err), err)
	}

	fmt.Printf("readers: %s\n", string(readers))
}

Starting pcscd

Hopefully your operating system does this for you with a nice init script but if not here you go:

$ sudo LIBCCID_ifdLogLevel=0x000F /usr/sbin/pcscd --foreground --debug --apdu --color
$ sudo /usr/sbin/pcscd --hotplug