Show / Hide Table of Contents

GetBioMetadata Method

GetBioMetadata()

Get information about YubiKey Bio multi-protocol.

C#
public PivBioMetadata GetBioMetadata()

Returns

PivBioMetadata

A new instance of a PivBioMetadata object.

Exceptions

Type Condition
NotSupportedException

The queried YubiKey does not support bio metadata.

ApduException

The operation could not be completed.

Remarks

This feature is available only on YubiKey Bio multi-protocol keys (FW 5.6 and later). If you call this method on an incompatible YubiKey, it will throw a NotSupportedException.

IEnumerable<IYubiKeyDevice> list = YubiKey.FindByTransport(Transport.UsbSmartCard);
IYubiKeyDevice yubiKey = list.First();
using (var pivSession = new PivSession(yubiKey))
{
    try
    {
        var bioMetaData = PivSession.GetBioMetadata();
        /* use bioMetaData */
    }
    catch (NotSupportedException e) {
        /* this device does not support Bio multi-protocol metadata */
    }
}

See the User's Manual entry on getting bio metadata for specifics about what information is returned.

In this article
Back to top Generated by DocFX