Files
apache
wp-content
mu-plugins
plugins
activitypub
audioigniter
authldap
companion-auto-update
gitium
gp-premium
jetpack-protect
menu-icons
simple-local-avatars
smtp-mailer
two-factor
w3-total-cache
wp-piwik
wp-webauthn
blocks
css
js
languages
wp-webauthn-vendor
beberlei
brick
composer
fgrosse
league
nyholm
psr
ramsey
spomky-labs
symfony
thecodingmachine
safe
deprecated
generated
Exceptions
apache.php
apcu.php
array.php
bzip2.php
calendar.php
classobj.php
com.php
cubrid.php
curl.php
datetime.php
dir.php
eio.php
errorfunc.php
exec.php
fileinfo.php
filesystem.php
filter.php
fpm.php
ftp.php
funchand.php
functionsList.php
gmp.php
gnupg.php
hash.php
ibase.php
ibmDb2.php
iconv.php
image.php
imap.php
info.php
ingres-ii.php
inotify.php
json.php
ldap.php
libxml.php
lzf.php
mailparse.php
mbstring.php
misc.php
msql.php
mysql.php
mysqli.php
mysqlndMs.php
mysqlndQc.php
network.php
oci8.php
opcache.php
openssl.php
outcontrol.php
password.php
pcntl.php
pcre.php
pdf.php
pgsql.php
posix.php
ps.php
pspell.php
readline.php
rpminfo.php
rrd.php
sem.php
session.php
shmop.php
simplexml.php
sockets.php
sodium.php
solr.php
spl.php
sqlsrv.php
ssdeep.php
ssh2.php
stream.php
strings.php
swoole.php
uodbc.php
uopz.php
url.php
var.php
xdiff.php
xml.php
xmlrpc.php
yaml.php
yaz.php
zip.php
zlib.php
lib
LICENSE
README.md
composer.json
rector-migrate-0.7.php
web-auth
web-token
autoload.php
LICENSE
readme.txt
wp-webauthn.php
wwa-admin-content.php
wwa-ajax.php
wwa-compatibility.php
wwa-functions.php
wwa-menus.php
wwa-profile-content.php
wwa-shortcodes.php
wwa-version.php
index.php
themes
upgrade-temp-backup
w3tc-config
index.php
.dbsetup
.gitignore
htaccess
php.ini

169 lines
3.8 KiB
PHP

<?php
namespace Safe;
use Safe\Exceptions\GnupgException;
/**
*
*
* @param resource $identifier The gnupg identifier, from a call to
* gnupg_init or gnupg.
* @param string $fingerprint The fingerprint key.
* @param string $passphrase The pass phrase.
* @throws GnupgException
*
*/
function gnupg_adddecryptkey($identifier, string $fingerprint, string $passphrase): void
{
error_clear_last();
$result = \gnupg_adddecryptkey($identifier, $fingerprint, $passphrase);
if ($result === false) {
throw GnupgException::createFromPhpError();
}
}
/**
*
*
* @param resource $identifier The gnupg identifier, from a call to
* gnupg_init or gnupg.
* @param string $fingerprint The fingerprint key.
* @throws GnupgException
*
*/
function gnupg_addencryptkey($identifier, string $fingerprint): void
{
error_clear_last();
$result = \gnupg_addencryptkey($identifier, $fingerprint);
if ($result === false) {
throw GnupgException::createFromPhpError();
}
}
/**
*
*
* @param resource $identifier The gnupg identifier, from a call to
* gnupg_init or gnupg.
* @param string $fingerprint The fingerprint key.
* @param string $passphrase The pass phrase.
* @throws GnupgException
*
*/
function gnupg_addsignkey($identifier, string $fingerprint, string $passphrase = null): void
{
error_clear_last();
if ($passphrase !== null) {
$result = \gnupg_addsignkey($identifier, $fingerprint, $passphrase);
} else {
$result = \gnupg_addsignkey($identifier, $fingerprint);
}
if ($result === false) {
throw GnupgException::createFromPhpError();
}
}
/**
*
*
* @param resource $identifier The gnupg identifier, from a call to
* gnupg_init or gnupg.
* @throws GnupgException
*
*/
function gnupg_cleardecryptkeys($identifier): void
{
error_clear_last();
$result = \gnupg_cleardecryptkeys($identifier);
if ($result === false) {
throw GnupgException::createFromPhpError();
}
}
/**
*
*
* @param resource $identifier The gnupg identifier, from a call to
* gnupg_init or gnupg.
* @throws GnupgException
*
*/
function gnupg_clearencryptkeys($identifier): void
{
error_clear_last();
$result = \gnupg_clearencryptkeys($identifier);
if ($result === false) {
throw GnupgException::createFromPhpError();
}
}
/**
*
*
* @param resource $identifier The gnupg identifier, from a call to
* gnupg_init or gnupg.
* @throws GnupgException
*
*/
function gnupg_clearsignkeys($identifier): void
{
error_clear_last();
$result = \gnupg_clearsignkeys($identifier);
if ($result === false) {
throw GnupgException::createFromPhpError();
}
}
/**
* Toggle the armored output.
*
* @param resource $identifier The gnupg identifier, from a call to
* gnupg_init or gnupg.
* @param int $armor Pass a non-zero integer-value to this function to enable armored-output
* (default).
* Pass 0 to disable armored output.
* @throws GnupgException
*
*/
function gnupg_setarmor($identifier, int $armor): void
{
error_clear_last();
$result = \gnupg_setarmor($identifier, $armor);
if ($result === false) {
throw GnupgException::createFromPhpError();
}
}
/**
* Sets the mode for signing.
*
* @param resource $identifier The gnupg identifier, from a call to
* gnupg_init or gnupg.
* @param int $signmode The mode for signing.
*
* signmode takes a constant indicating what type of
* signature should be produced. The possible values are
* GNUPG_SIG_MODE_NORMAL,
* GNUPG_SIG_MODE_DETACH and
* GNUPG_SIG_MODE_CLEAR.
* By default GNUPG_SIG_MODE_CLEAR is used.
* @throws GnupgException
*
*/
function gnupg_setsignmode($identifier, int $signmode): void
{
error_clear_last();
$result = \gnupg_setsignmode($identifier, $signmode);
if ($result === false) {
throw GnupgException::createFromPhpError();
}
}