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

gnupg_import

PHP function Edit on GitHub ✎

(PECL gnupg >= 0.3)

Imports a key

Description

gnupg_import(resource $identifier, string $keydata): array|false

Imports the key keydata and returns an array with information about the importprocess.

Parameters

identifier

Identifier

keydata

The data key that is being imported.

Return Values

On success, this function returns and info-array about the importprocess. On failure, this function returns false.

Examples

Procedural gnupg_import() example

php
<?php
$res = gnupg_init();
$info = gnupg_import($res,$keydata);
print_r($info);
?>

OO gnupg_import() example

php
<?php
$gpg = new gnupg();
$info = $gpg->import($keydata);
print_r($info);
?>

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