TryChangePin Method
TryChangePin()
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 and a new PIN and use them to change the U2F PIN.
If the caller cancels (the return from the KeyCollector
is
false
), this will return false
.
public bool TryChangePin()
Returns
A boolean, true
if the PIN is changed, false
if the user
cancels PIN collection.
Exceptions
Type | Condition |
---|---|
System.Security.SecurityException | The YubiKey is not version 4 FIPS series, or the PIN is blocked. |
Remarks
See the documentation for ChangePin() for more information on changing a PIN.
TryChangePin(ReadOnlyMemory<Byte>, ReadOnlyMemory<Byte>)
For a version 4 FIPS series YubiKey that has a PIN set on the U2F
application, this will use the provided current and new PINs to
change the U2F PIN. If the current PIN given is not correct, or the
new PIN is not a correct length, this method will return false
.
public bool TryChangePin(ReadOnlyMemory<byte> currentPin, ReadOnlyMemory<byte> newPin)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlyMemory<System.Byte> | currentPin | |
System.ReadOnlyMemory<System.Byte> | newPin |
Returns
A boolean, true
if the PIN is changed, false
otherwise.
Exceptions
Type | Condition |
---|---|
System.Security.SecurityException | The PIN is blocked. |
System.NotSupportedException | The YubiKey is not version 4 FIPS series. |
Remarks
See the documentation for ChangePin() for more information on changing a PIN.