Class: Crypt_GPG
Source Location: /Crypt_GPG-0.3.11/GPG.php
A class to use GPG from PHP
Author(s):
Copyright:
|
|
Child classes:
|
Inherited Variables
|
Inherited Methods
|
Class Details
Method Detail
__construct (Constructor) [line 216]
Crypt_GPG __construct(
[array
$options = null])
|
|
Creates a new Crypt_GPG object The Crypt_GPG::factory() method must be used to instantiate a Crypt_GPG object.
Overridden in child classes as:
- Crypt_GPG_Driver_Php::__construct()
- Creates a new GPG object that uses PHP's native process manipulation functions to control the GPG process
Parameters:
decrypt [line 506]
string decrypt(
string
$encrypted_data, [string
$passphrase = null])
|
|
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.
Overridden in child classes as:
- Crypt_GPG_Driver_Php::decrypt()
- Decrypts string data using the given passphrase
Parameters:
deletePrivateKey [line 329]
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.
Overridden in child classes as:
- Crypt_GPG_Driver_Php::deletePrivateKey()
- Deletes a private key from the keyring
Parameters:
deletePublicKey [line 302]
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.
Overridden in child classes as:
- Crypt_GPG_Driver_Php::deletePublicKey()
- Deletes a public key from the keyring
Parameters:
encrypt [line 470]
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:
Overridden in child classes as:
- Crypt_GPG_Driver_Php::encrypt()
- Encrypts string data
Parameters:
exportPublicKey [line 275]
string exportPublicKey(
string
$key_id, [boolean
$armor = true])
|
|
Exports a public key from the keyring The exported key remains on the keyring. To delete the public key, use Crypt_GPG::deletePublicKey(). 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 exported.
Overridden in child classes as:
- Crypt_GPG_Driver_Php::exportPublicKey()
- Exports a public key from the keyring
Parameters:
factory [line 184]
Crypt_GPG factory(
[string
$driver = 'php'], [array
$options = array()])
|
|
Static factory method to create a new GPG object using the specified backend driver This allows developers to write code using a standard interface and optionally switch to a PECL-based implementation with minimal fuss at a later date.
Parameters:
getPrivateFingerprint [line 429]
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.
Overridden in child classes as:
- Crypt_GPG_Driver_Php::getPrivateFingerprint()
- Gets a private key fingerprint from the keyring
Parameters:
getPrivateKeys [line 361]
getPublicFingerprint [line 395]
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.
Overridden in child classes as:
- Crypt_GPG_Driver_Php::getPublicFingerprint()
- Gets a public key fingerprint from the keyring
Parameters:
getPublicKeys [line 345]
importKey [line 242]
sign [line 555]
string sign(
string
$key_id, string
$data, [string
$passphrase = null], [boolean
$mode = self::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:
Overridden in child classes as:
- Crypt_GPG_Driver_Php::sign()
- Signs data using the given key and passphrase
Parameters:
verify [line 587]
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.
Overridden in child classes as:
- Crypt_GPG_Driver_Php::verify()
- Verifies signed data
Parameters:
Documentation generated on Mon, 11 Mar 2019 15:14:51 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|