Show / Hide Table of Contents

TryVerifyPassword Method

TryVerifyPassword()

Attempts to verify the password.

C#
public bool TryVerifyPassword()

Returns

bool

Exceptions

Type Condition
InvalidOperationException

There is no KeyCollector loaded.

Remarks

Performs mutual authentication with the YubiKey using the password collected by the key collector. You need to verify the password only once per session if the authentication is configured for the OATH application on the YubiKey.

TryVerifyPassword(ReadOnlyMemory<byte>)

Try to verify using the given password.

C#
public bool TryVerifyPassword(ReadOnlyMemory<byte> password)

Parameters

Type Name Description
ReadOnlyMemory<byte> password

The password to verify.

Returns

bool

A boolean, true if the password verifies, and false otherwise.

Exceptions

Type Condition
InvalidOperationException

The YubiKey had some error, such as unreliable connection.

Remarks

Perform mutual authentication with the YubiKey using the password given. You need to verify the password only once per session if authentication is enabled for the OATH application on the YubiKey.

If the OATH application is not password-protected (IsPasswordProtected is false), the given password obviously does not verify, so the method will return false.

If the password has already been verified during this session, this method will try to verify it again. If it fails, the return will be false, but the session will still be verified and it will still be able to perform operations.

In this article
Back to top Generated by DocFX