array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'function.rnp-ffi-set-pass-provider.php', 1 => 'rnp_ffi_set_pass_provider', ), 'up' => array ( 0 => 'ref.rnp.php', 1 => 'Rnp İşlevleri', ), 'prev' => array ( 0 => 'function.rnp-ffi-destroy.php', 1 => 'rnp_ffi_destroy', ), 'next' => array ( 0 => 'function.rnp-import-keys.php', 1 => 'rnp_import_keys', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/rnp/functions/rnp-ffi-set-pass-provider.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL rnp >= 0.1.1)
rnp_ffi_set_pass_provider — Set password provider callback function
Sets password provider function. This function can ask for the password on a standard input (if PHP script is executed in a command line environment), display GUI dialog or provide password in any other possible ways. Requested passwords are used to encrypt or decrypt secret keys or perform symmetric encryption/decryption operations.
ffi
rnp_ffi_create tarafından döndürülen FFI nesnesi.
password_callback
The function that is to be called for every password request. It has the following signature:
$key_fp
- The key fingerprint, if any. Can be empty.$pgp_context
- String describing why the key is being requested.$password
- Password string reference where provided password should be stored to.true
if password was successfully set başarısızlık durumunda false
döner.
Örnek 1 simple callback function example
<?php
function password_callback(string $key_fp, string $pgp_context, string &$password)
{
$password = "password";
return true;
}
$ffi = rnp_ffi_create('GPG', 'GPG');
rnp_ffi_set_pass_provider($ffi, 'password_callback');