Show / Hide Table of Contents

UseSerialNumberAsPublicId Method

UseSerialNumberAsPublicId(Memory<byte>?)

Uses a binary representation of the YubiKey serial number as the public ID for this credential.

C#
public ConfigureYubicoOtp UseSerialNumberAsPublicId(Memory<byte>? publicId = null)

Parameters

Type Name Description
Memory<byte>? publicId

A System.Memory<T> object to receive the public ID. This object must be exactly six bytes.

Returns

ConfigureYubicoOtp

The current ConfigureYubicoOtp instance.

Exceptions

Type Condition
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.

In this article
Back to top Generated by DocFX