How to retrieve Yubikey's model with a NFC connection

26 views Asked by At

My Android application connects to a Yubikey using NFC and create a PivSession:

yubiKitManager.startNfcDiscovery(new NfcConfiguration(), this, device -> {
    if (device.isYubiKey()) {
        SmartCardConnection connection;
        try {
            connection = device.openConnection(SmartCardConnection.class);
            PivSession pivSession = new PivSession(connection);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}

I would have like to be able to retrieve the model name of the Yubikey, for example "Yubikey 5C NFC". Unfortunately, I was unable to find a function that would let me do this in the Javadoc. This does not seem to be possible from the device, SmartcardConnection or PivSession.

I tried to retrieve other information such as the firmware version or the serial number, but I am unable to see how they could help me to identify the model. There could maybe be a possibility to look for the model in a database using the serial number, but I haven't found such public database.

I also tried to think in terms of capabilities (NFC or not, number of keys that can be stored, ...), but it wouldn't help me distinguish a Yubikey 5C from a Yubikey 5 for instance.

As anyone another idea?

0

There are 0 answers