UsePublicId Method
UsePublicId(ReadOnlyMemory<Byte>)
Explicitly sets the public ID of the Yubico OTP credential.
C#
public ConfigureYubicoOtp UsePublicId(ReadOnlyMemory<byte> publicId)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlyMemory<System.Byte> | publicId | A collection of bytes to use for the public ID. |
Returns
The current ConfigureYubicoOtp instance.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | This is thrown when the byte collection is not the appropriate size. |
System.InvalidOperationException | This is thrown when UseSerialNumberAsPublicId(Nullable<Memory<Byte>>) has been called before this. |
System.AggregateException | This is thrown when multiple exceptions have been encountered. |
Remarks
The Yubico OTP online service requires the public ID to begin with 0xff (or "vv" in ModHex). If the credential will be uploaded, you must validate this or it will fail.
Setting an explicit public ID is not compatible with using the YubiKey serial number as the public ID. Specifying both will result in an exception.