-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
I'm using this module via https://github.com/yawn/ykoath/blob/master/ykoath.go and running into something I'd like to implement.
Right now, if I have multiple yubikeys plugged in, they get the same reader name, suffixed with an integer, but the naming is based on insertion order, so it changes depending on which device I plug in first.
As an example:
package main
import (
"fmt"
"github.com/ebfe/scard"
)
func main() {
context, err := scard.EstablishContext()
if err != nil {
panic(err)
}
readers, err := context.ListReaders()
if err != nil {
panic(err)
}
for _, reader := range readers {
fmt.Println(reader)
}
}
❯ go run ./main.go
Yubico YubiKey OTP+FIDO+CCID
Yubico YubiKey OTP+FIDO+CCID 01
I poked around a bit at this library to see if there's a way to pull a unique identifier from the attributes, but this seems like the obly attributes that the yubikey supports (thought supports is a bit of a stretch, given that most of them are blank):
Yubico YubiKey OTP+FIDO+CCID 01: AttrChannelId:
Yubico YubiKey OTP+FIDO+CCID 01: AttrIccPresence:
Yubico YubiKey OTP+FIDO+CCID 01: AttrIccInterfaceStatus:
Yubico YubiKey OTP+FIDO+CCID 01: AttrAtrString: ;��1��s�!�WYubiKey@
Yubico YubiKey OTP+FIDO+CCID 01: AttrMaxinput: �
Yubico YubiKey OTP+FIDO+CCID 01: AttrVendorName: Yubico
Yubico YubiKey OTP+FIDO+CCID 01: AttrVendorIfdVersion: C
Yubico YubiKey OTP+FIDO+CCID 01: AttrVendorIfdSerialNo:
Are you aware of a way I can differentiate between the smartcards in a deterministic way?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels