Show / Hide Table of Contents

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
ReadOnlyMemory<byte> publicId

A collection of bytes to use for the public ID.

Returns

ConfigureYubicoOtp

The current ConfigureYubicoOtp instance.

Exceptions

Type Condition
ArgumentException

This is thrown when the byte collection is not the appropriate size.

InvalidOperationException

This is thrown when UseSerialNumberAsPublicId(Memory<byte>?) has been called before this.

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.

In this article
Back to top Generated by DocFX