php8.5
Home/ Manual/ gnupg / functions/ gnupg_getprotocol

gnupg_getprotocol

PHP function Edit on GitHub ✎

(PECL gnupg >= 0.1)

Returns the currently active protocol for all operations

Description

gnupg_getprotocol(resource $identifier): int

Parameters

identifier

Identifier

Return Values

Returns the currently active protocol, which can be one of GNUPG_PROTOCOL_OpenPGP or GNUPG_PROTOCOL_CMS.

Examples

Procedural gnupg_getprotocol() example

php
<?php
$res = gnupg_init();
echo gnupg_getprotocol($res);
?>

OO gnupg_getprotocol() example

php
<?php
$gpg = new gnupg();
echo $gpg->getprotocol();
?>

Source: reference/gnupg/functions/gnupg-getprotocol.xml · from the official PHP manual (php/doc-en)