openpgp-php/examples
Stephen Paul Weber d27d30a352
Implement encryptSecretKey
Allow encrypting a decrypted secret key, which is especially useful for
generating a new encrypted secret key.  Defaults to AES256, S2K
iter+salt SHA512, always uses s2k_useage 254 with sha1 integrity
protection of the encrypted key material.

Also add an example to parallel keygen.php that generates a key and then
encrypts it with a passphrase.
2019-09-10 21:31:06 -05:00
..
clearsign.php Provide more guidance for understanding examples, update .travis.yml. 2018-12-20 13:42:15 -07:00
deASCIIdeCrypt.php Provide more guidance for understanding examples, update .travis.yml. 2018-12-20 13:42:15 -07:00
encryptDecrypt.php Provide more guidance for understanding examples, update .travis.yml. 2018-12-20 13:42:15 -07:00
keygen.php Provide more guidance for understanding examples, update .travis.yml. 2018-12-20 13:42:15 -07:00
keygenEncrypted.php Implement encryptSecretKey 2019-09-10 21:31:06 -05:00
README.md Provide more guidance for understanding examples, update .travis.yml. 2018-12-20 13:42:15 -07:00
sign.php Provide more guidance for understanding examples, update .travis.yml. 2018-12-20 13:42:15 -07:00
verify.php Provide more guidance for understanding examples, update .travis.yml. 2018-12-20 13:42:15 -07:00

OpenPGP.php Examples

The scripts in this folder show how to use this library to perform various tasks such as generating a new key, signing a message, and verifying a message that has been signed.

To use these examples, make sure phpseclib is available. You can install it using Composer:

git clone https://github.com/singpolyma/openpgp-php.git # Clone the repository.
cd openpgp-php
composer install # Use Composer to install the requirements.

Once Composer has installed the requirements, run the examples using PHP:

# Generate a new OpenPGP key; see the `keygen.php` file for parameters.
php ./examples/keygen.php > mykey.gpg