diff --git a/generated/functionsList.php b/generated/functionsList.php index bf152651..58e78822 100644 --- a/generated/functionsList.php +++ b/generated/functionsList.php @@ -256,6 +256,7 @@ 'gnupg_cleardecryptkeys', 'gnupg_clearencryptkeys', 'gnupg_clearsignkeys', + 'gnupg_deletekey', 'gnupg_setarmor', 'gnupg_setsignmode', 'gzclose', diff --git a/generated/gnupg.php b/generated/gnupg.php index b5d85ca3..0ecb886b 100644 --- a/generated/gnupg.php +++ b/generated/gnupg.php @@ -121,6 +121,26 @@ function gnupg_clearsignkeys($identifier): void } +/** + * + * + * @param resource $identifier The gnupg identifier, from a call to + * gnupg_init or gnupg. + * @param string $key The key to delete. + * @param bool $allow_secret It specifies whether to delete secret keys as well. + * @throws GnupgException + * + */ +function gnupg_deletekey($identifier, string $key, bool $allow_secret): void +{ + error_clear_last(); + $result = \gnupg_deletekey($identifier, $key, $allow_secret); + if ($result === false) { + throw GnupgException::createFromPhpError(); + } +} + + /** * Toggle the armored output. * diff --git a/rector-migrate.php b/rector-migrate.php index 33d71034..d6d92b6c 100644 --- a/rector-migrate.php +++ b/rector-migrate.php @@ -266,6 +266,7 @@ 'gnupg_cleardecryptkeys' => 'Safe\gnupg_cleardecryptkeys', 'gnupg_clearencryptkeys' => 'Safe\gnupg_clearencryptkeys', 'gnupg_clearsignkeys' => 'Safe\gnupg_clearsignkeys', + 'gnupg_deletekey' => 'Safe\gnupg_deletekey', 'gnupg_setarmor' => 'Safe\gnupg_setarmor', 'gnupg_setsignmode' => 'Safe\gnupg_setsignmode', 'gzclose' => 'Safe\gzclose',