GnuPG Functions
Notes
This extension makes use of the keyring of the current user. This keyring is normally located in ~./.gnupg/. To specify a custom location, store the path to the keyring in the environment variable GNUPGHOME. See putenv for more information how to do this.
Some functions require the specification of a key. This specification can be anything that refers to a unique key (userid, key-id, fingerprint, ...). This documentation uses the fingerprint in all examples.
Note:
As alternative to the explicitly documented functions using resources, you can also use an object-oriented style using gnupg objects.
Table of Contents
- gnupg_adddecryptkey — Add a key for decryption
- gnupg_addencryptkey — Add a key for encryption
- gnupg_addsignkey — Add a key for signing
- gnupg_cleardecryptkeys — Removes all keys which were set for decryption before
- gnupg_clearencryptkeys — Removes all keys which were set for encryption before
- gnupg_clearsignkeys — Removes all keys which were set for signing before
- gnupg_decrypt — Decrypts a given text
- gnupg_decryptverify — Decrypts and verifies a given text
- gnupg_encrypt — Encrypts a given text
- gnupg_encryptsign — Encrypts and signs a given text
- gnupg_export — Exports a key
- gnupg_geterror — Returns the errortext, if a function fails
- gnupg_getprotocol — Returns the currently active protocol for all operations
- gnupg_import — Imports a key
- gnupg_init — Initialize a connection
- gnupg_keyinfo — Returns an array with information about all keys that matches the given pattern
- gnupg_setarmor — Toggle armored output
- gnupg_seterrormode — Sets the mode for error_reporting
- gnupg_setsignmode — Sets the mode for signing
- gnupg_sign — Signs a given text
- gnupg_verify — Verifies a signed text
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-ref.gnupg.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.