UseSerialNumberAsPublicId Method
UseSerialNumberAsPublicId(Nullable<Memory<Byte>>)
Uses a binary representation of the YubiKey serial number as the public ID for this credential.
C#
public ConfigureYubicoOtp UseSerialNumberAsPublicId(Nullable<Memory<byte>> publicId = null)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Memory<System.Byte>> | publicId | A System.Memory<> object to receive the public ID. This object must be exactly six bytes. |
Returns
The current ConfigureYubicoOtp instance.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This will be thrown either if the caller called UsePublicId(ReadOnlyMemory<Byte>) before calling this method, or if the serial number is not readable on the YubiKey. |
Remarks
Using the YubiKey serial number is not compatible with setting an explicit byte collection as the public ID. Specifying both will result in an exception.
If you do not need to receive the public ID that was generated from the serial number, you can either pass null or simply nothing.