gnupg_init

(PECL gnupg >= 0.4)

gnupg_initInitialize a connection

Description

gnupg_init(?array $options = null): resource

Parameters

options

Must be an associative array. It is used to change the default configuration of the crypto engine.

Configuration overrides
key type description
file_name string It is the file name of the executable program implementing this protocol which is usually path of the gpg executable.
home_dir string It is the directory name of the configuration directory. It also overrides GNUPGHOME environment variable that is used for the same purpose.

Return Values

A GnuPG resource connection used by other GnuPG functions.

Changelog

Version Description
1.5.0 The options parameter was added.

Examples

Example #1 Procedural gnupg_init() example with default setting

<?php
$res 
gnupg_init();
?>

Example #2 Procedural gnupg_init() example with overriden file name and home dir

<?php
$res 
gnupg_init(["file_name" => "/usr/bin/gpg2""home_dir" => "/var/www/.gnupg"]);
?>

Example #3 OO gnupg initializer example with default setting

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

Example #4 OO gnupg initializer example with overriden file name and home dir

<?php
$gpg 
= new gnupg(["file_name" => "/usr/bin/gpg2""home_dir" => "/var/www/.gnupg"]);
?>

Here you can write a comment


Please enter at least 10 characters.
Loading... Please wait.
* Pflichtangabe
There are no comments available yet.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Category: Software & Web-Development

PHP cURL Tutorial: Using cURL to Make HTTP Requests

cURL is a powerful PHP extension that allows you to communicate with different servers using various protocols, including HTTP, HTTPS, FTP, and more. ...

TheMax

Autor : TheMax
Category: PHP-Tutorials

Midjourney Tutorial - Instructions for beginners

There is an informative video about Midjourney, the tool for creating digital images using artificial intelligence, entitled "Midjourney tutorial in German - instructions for beginners" ...

Mike94

Autor : Mike94
Category: KI Tutorials

Publish a tutorial

Share your knowledge with other developers worldwide

Share your knowledge with other developers worldwide

You are a professional in your field and want to share your knowledge, then sign up now and share it with our PHP community

learn more

Publish a tutorial