All Projects → jessfraz → ykpiv

jessfraz / ykpiv

Licence: MIT license
Go bindings for ykpiv so you can write Go to interact with your yubikeys.

Programming Languages

go
31211 projects - #10 most used programming language
c
50402 projects - #5 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects
shell
77523 projects

Table of Contents

ykpiv

make-all make-image make-test GoDoc

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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].