Changes private key password.
If more than one key pairs exist with the supplied userId, only the first one is affected.
This method is equivalent to the GnuPG commands:
gpg --edit-key [userId]
Command>passwd
Namespace: DidiSoft.PgpIf more than one key pairs exist with the supplied userId, only the first one is affected.
This method is equivalent to the GnuPG commands:
gpg --edit-key [userId]
Command>passwd
Assembly: DidiSoft.Pgp (in DidiSoft.Pgp.dll) Version: 1.7.3.35547
Syntax
| C# |
|---|
public virtual bool ChangePrivateKeyPassword( string userId, string oldPassword, string newPassword ) |
| Visual Basic |
|---|
Public Overridable Function ChangePrivateKeyPassword ( _ userId As String, _ oldPassword As String, _ newPassword As String _ ) As Boolean |
| Visual C++ |
|---|
public: virtual bool ChangePrivateKeyPassword( String^ userId, String^ oldPassword, String^ newPassword ) |
Parameters
- userId
- Type: System..::..String
User Id of the form "name (comment) <email address>"
- oldPassword
- Type: System..::..String
current password of the private key
- newPassword
- Type: System..::..String
new password of the private key
Return Value
true if private key password is changed, false if there is no key with the specified userId
Exceptions
| Exception | Condition |
|---|---|
| DidiSoft.Pgp.Exceptions..::..WrongPasswordException | The supplied current password is incorrect |