Next: , Previous: , Up: Key Management   [Contents][Index]


7.5.10 Changing Passphrases

Function: gpgme_error_t gpgme_op_passwd (gpgme_ctx_t ctx, const gpgme_key_t key, unsigned int flags)

SINCE: 1.3.0

The function gpgme_op_passwd changes the passphrase of the private key associated with key. The only allowed value for flags is 0. The backend engine will usually popup a window to ask for the old and the new passphrase. Thus this function is not useful in a server application (where passphrases are not required anyway).

Note that old gpg engines (before version 2.0.15) do not support this command and will silently ignore it.

Function: gpgme_error_t gpgme_op_passwd_start (gpgme_ctx_t ctx, const gpgme_key_t key, unsigned int flags)

SINCE: 1.3.0

The function gpgme_op_passwd_start initiates a gpgme_op_passwd operation. It can be completed by calling gpgme_wait on the context. See Waiting For Completion.

The function returns 0 if the operation was started successfully, and an error code if one of the arguments is not valid or the oepration could not be started.