SetPassword Method
SetPassword()
Sets the password.
public void SetPassword()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | There is no |
System.OperationCanceledException | The user canceled password collection. |
System.Security.SecurityException | Unable to verify password because the incorrect current password was provided. |
Remarks
If the authentication was previously configured on the YubiKey, this method will prompt for the current password to verify, as well as a new password to change to using the KeyCollector callback. If the authentication is not configured, this method will collect only a new password to set. In this case, the challenge supplied from the YubiKey will be an empty byte array meaning no password was set yet. The password can be any string of bytes, however most applications will choose to encode a user supplied string using UTF-8. Next, 1,000 rounds of PBKDF2 are applied with a salt supplied by the YubiKey, ensuring an extra level of security against brute force attacks.