TryVerifyPassword Method
TryVerifyPassword()
Attempts to verify the password.
public bool TryVerifyPassword()
Returns
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | There is no |
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.
public bool TryVerifyPassword(ReadOnlyMemory<byte> password)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlyMemory<System.Byte> | password | The password to verify. |
Returns
A boolean, true
if the password verifies, and false
otherwise.
Exceptions
Type | Condition |
---|---|
System.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.