Show / Hide Table of Contents

TryVerifyPin Method

TryVerifyPin()

For a version 4 FIPS series YubiKey that has a PIN set on the U2F application, this will call on the KeyCollector to obtain the current PIN and verify it. If the caller cancels (the return from the KeyCollector is false), this will return false.

C#
public bool TryVerifyPin()

Returns

bool

A boolean, true if the PIN is verified, false if the user cancels PIN collection.

Exceptions

Type Condition
SecurityException

The YubiKey is not version 4 FIPS series, or the PIN is blocked.

Remarks

See the documentation for VerifyPin() for more information on verifying a PIN.

TryVerifyPin(ReadOnlyMemory<byte>)

For a version 4 FIPS series YubiKey that has a PIN set on the U2F application, this try to verify the given pin. If the PIN is not verified, this method will return false.

C#
public bool TryVerifyPin(ReadOnlyMemory<byte> pin)

Parameters

Type Name Description
ReadOnlyMemory<byte> pin

Returns

bool

A boolean, true if the PIN is verified, false otherwise.

Exceptions

Type Condition
SecurityException

The PIN is blocked.

NotSupportedException

The YubiKey is not version 4 FIPS series.

Remarks

See the documentation for VerifyPin() for more information on verifying a PIN.

In this article
Back to top Generated by DocFX