Class: Crypt_GPG_Driver_Php
Source Location: /Crypt_GPG-0.3.10/GPG/Driver/Php.php
Crypt_GPG
|
--Crypt_GPG_Driver_Php
Native PHP Crypt_GPG driver
Author(s):
Copyright:
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
__construct (Constructor) [line 239]
Crypt_GPG_Driver_Php __construct(
[array
$options = array()])
|
|
Creates a new GPG object that uses PHP's native process manipulation functions to control the GPG process Developers are encouraged to use the Crypt_GPG::factory() method to instantiate this class. Available options for this driver are: - string homedir: The directory where the GPG keyring files are
stored. If not specified, GPG uses the default of
$HOME/.gnupg, where $HOME is the present user's
home directory. This option only needs to be
specified when $HOME/.gnupg is inappropriate.
- string gpg_binary: The location of the GPG binary. If not specified,
defaults to '/usr/bin/gpg'.
Overrides Crypt_GPG::__construct() (Creates a new Crypt_GPG object)
Parameters:
__destruct (Destructor) [line 263]
Closes open GPG subprocesses when this object is destroyed Subprocesses should never be left open by this class unless there is an unknown error and unexpected script termination occurs.
decrypt [line 743]
string decrypt(
string
$encrypted_data, string
$passphrase)
|
|
Decrypts string data using the given passphrase This method assumes the required private key is available in the keyring and throws an exception if the private key is not available. To add a private key to the keyring, use the Crypt_GPG::importKey() method. Calls GPG with the --decrypt command and passes the passphrase and encrypted data.
Overrides Crypt_GPG::decrypt() (Decrypts string data using the given passphrase)
Parameters:
deletePrivateKey [line 404]
void deletePrivateKey(
string
$key_id)
|
|
Deletes a private key from the keyring If more than one key fingerprint is avaliable for the specified $key_id (for example, if you use a non-unique uid) only the first private key is deleted. Calls GPG with the --delete-secret-key option.
Overrides Crypt_GPG::deletePrivateKey() (Deletes a private key from the keyring)
Parameters:
deletePublicKey [line 353]
void deletePublicKey(
string
$key_id)
|
|
Deletes a public key from the keyring If more than one key fingerprint is avaliable for the specified $key_id (for example, if you use a non-unique uid) only the first public key is deleted. Calls GPG with the --delete-key option.
Overrides Crypt_GPG::deletePublicKey() (Deletes a public key from the keyring)
Parameters:
encrypt [line 654]
string encrypt(
string
$key_id, string
$data, [boolean
$armor = true])
|
|
Encrypts string data Data is ASCII armored by default but may optionally be returned as binary. If this method throws a Crypt_GPG_MissingSelfSignatureException, the public key needs to be signed. Keys may be manually signed using the shell command:
Encrypts data
Calls GPG with the --encrypt command.
Overrides Crypt_GPG::encrypt() (Encrypts string data)
Parameters:
getPrivateFingerprint [line 577]
string getPrivateFingerprint(
string
$key_id, [boolean
$separator = ''])
|
|
Gets a private key fingerprint from the keyring If more than one private key fingerprint is avaliable (for example, if you use a non-unique uid) only the first private key fingerprint is returned. Only private key fingerprints are returned. See Crypt_GPG::getPublicFingerprint() to get the fingerprint of a public key. Calls the GPG --list-secret-keys command with the --with-fingerprint option to retrieve a private key fingerprint.
Overrides Crypt_GPG::getPrivateFingerprint() (Gets a private key fingerprint from the keyring)
Parameters:
getPrivateKeys [line 467]
Gets the available private keys in the keyring Calls GPG with the --list-private-keys option and grabs private keys.
Overrides Crypt_GPG::getPrivateKeys() (Gets the available private keys in the keyring)
getPublicFingerprint [line 507]
string getPublicFingerprint(
string
$key_id, [boolean
$separator = ''])
|
|
Gets a public key fingerprint from the keyring If more than one public key fingerprint is avaliable (for example, if you use a non-unique uid) only the first public key fingerprint is returned. Only public key fingerprints are returned. See Crypt_GPG::getPrivateFingerprint() to get the fingerprint of a private key. Calls the GPG --list-keys command with the --with-fingerprint option to retrieve a public key fingerprint.
Overrides Crypt_GPG::getPublicFingerprint() (Gets a public key fingerprint from the keyring)
Parameters:
getPublicKeys [line 445]
Gets the available public keys in the keyring Calls GPG with the --list-public-keys option and grabs public keys.
Overrides Crypt_GPG::getPublicKeys() (Gets the available public keys in the keyring)
importKey [line 295]
sign [line 834]
string sign(
string
$key_id, string
$data, string
$passphrase, [boolean
$mode = Crypt_GPG::SIGN_MODE_NORMAL], [boolean
$armor = true])
|
|
Signs data using the given key and passphrase Data my be signed using and one of the three available signing modes: Calls GPGP with the --sign, --clearsign or --detach-sign commands.
Overrides Crypt_GPG::sign() (Signs data using the given key and passphrase)
Parameters:
verify [line 924]
Verifies signed data The Crypt_GPG::decrypt() method may be used to get the original message if the signed data is not clearsigned and does not have a detached signature. Calls GPG with the --verify option to verify signature data.
Overrides Crypt_GPG::verify() (Verifies signed data)
Parameters:
_getKeys [line 1042]
array _getKeys(
boolean
$public)
|
|
Helper method for getting public or private keys See the first section of doc/DETAILS in the GPG package for a detailed description of how the GPG output is parsed.
Parameters:
Documentation generated on Mon, 11 Mar 2019 15:14:43 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|