schneespur/release/schneespur-1.0.2/vendor/thecodingmachine/safe/generated/8.2/gnupg.php
Michael 7288b93500 Release v1.0.2: diagnostic infrastructure core
Add neutral diagnostic framework for future reporting modules:
- DiagnosticReporterInterface, Registry, Manager, PayloadSanitizer
- Laravel exception hook in bootstrap/app.php
- Module permission declarations (requires_permissions in module.json)
- Core diagnostic report points (module boot/install/update failures)
- Module documentation update (moduldoku.md)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-18 16:54:11 +00:00

152 lines
3.2 KiB
PHP

<?php
namespace Safe;
use Safe\Exceptions\GnupgException;
/**
* @param resource $identifier
* @param string $fingerprint
* @param string $passphrase
* @throws GnupgException
*
*/
function gnupg_adddecryptkey($identifier, string $fingerprint, string $passphrase): void
{
error_clear_last();
$safeResult = \gnupg_adddecryptkey($identifier, $fingerprint, $passphrase);
if ($safeResult === false) {
throw GnupgException::createFromPhpError();
}
}
/**
* @param resource $identifier
* @param string $fingerprint
* @throws GnupgException
*
*/
function gnupg_addencryptkey($identifier, string $fingerprint): void
{
error_clear_last();
$safeResult = \gnupg_addencryptkey($identifier, $fingerprint);
if ($safeResult === false) {
throw GnupgException::createFromPhpError();
}
}
/**
* @param resource $identifier
* @param string $fingerprint
* @param string $passphrase
* @throws GnupgException
*
*/
function gnupg_addsignkey($identifier, string $fingerprint, ?string $passphrase = null): void
{
error_clear_last();
if ($passphrase !== null) {
$safeResult = \gnupg_addsignkey($identifier, $fingerprint, $passphrase);
} else {
$safeResult = \gnupg_addsignkey($identifier, $fingerprint);
}
if ($safeResult === false) {
throw GnupgException::createFromPhpError();
}
}
/**
* @param resource $identifier
* @throws GnupgException
*
*/
function gnupg_cleardecryptkeys($identifier): void
{
error_clear_last();
$safeResult = \gnupg_cleardecryptkeys($identifier);
if ($safeResult === false) {
throw GnupgException::createFromPhpError();
}
}
/**
* @param resource $identifier
* @throws GnupgException
*
*/
function gnupg_clearencryptkeys($identifier): void
{
error_clear_last();
$safeResult = \gnupg_clearencryptkeys($identifier);
if ($safeResult === false) {
throw GnupgException::createFromPhpError();
}
}
/**
* @param resource $identifier
* @throws GnupgException
*
*/
function gnupg_clearsignkeys($identifier): void
{
error_clear_last();
$safeResult = \gnupg_clearsignkeys($identifier);
if ($safeResult === false) {
throw GnupgException::createFromPhpError();
}
}
/**
* @param resource $identifier
* @param string $key
* @param bool $allow_secret
* @throws GnupgException
*
*/
function gnupg_deletekey($identifier, string $key, bool $allow_secret): void
{
error_clear_last();
$safeResult = \gnupg_deletekey($identifier, $key, $allow_secret);
if ($safeResult === false) {
throw GnupgException::createFromPhpError();
}
}
/**
* @param resource $identifier
* @param int $armor
* @throws GnupgException
*
*/
function gnupg_setarmor($identifier, int $armor): void
{
error_clear_last();
$safeResult = \gnupg_setarmor($identifier, $armor);
if ($safeResult === false) {
throw GnupgException::createFromPhpError();
}
}
/**
* @param resource $identifier
* @param int $signmode
* @throws GnupgException
*
*/
function gnupg_setsignmode($identifier, int $signmode): void
{
error_clear_last();
$safeResult = \gnupg_setsignmode($identifier, $signmode);
if ($safeResult === false) {
throw GnupgException::createFromPhpError();
}
}