ChangePin Method
ChangePin()
Changes the PIN using the KeyCollector
.
C#
public void ChangePin()
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | The user cancelled PIN collection. This happens when the application returns |
Fido2Exception | The YubiKey returned an error indicating that the change PIN request could not be completed. |
Remarks
FIDO2 separates the action of setting the initial PIN from changing it. Use SetPin() to set the first PIN, and use this method to change the PIN after that. In order to change the PIN, both the current PIN and the new PIN must be supplied. A PIN cannot be removed from FIDO2. The only way to clear the PIN is to reset the entire FIDO2 application, which will result in all credentials being removed.
Several considerations must be made when collecting the PIN.
- It must be encoded in UTF-8 with Normalization Form C.
- It must be at least 4 Unicode code points in length.
- It must not exceed 63 bytes in encoded length.