Class: Crypt_GPG
Source Location: /Crypt_GPG-1.4.0b4/Crypt/GPG.php
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
addDecryptKey [line 1206]
Crypt_GPG addDecryptKey(
mixed
$key, [string
$passphrase = null])
|
|
Adds a key to use for decryption
Parameters:
addEncryptKey [line 1230]
Adds a key to use for encryption
Parameters:
addSignKey [line 1259]
Crypt_GPG addSignKey(
mixed
$key, [string
$passphrase = null])
|
|
Adds a key to use for signing
Parameters:
clearDecryptKeys [line 1276]
Clears all decryption keys
clearEncryptKeys [line 1293]
Clears all encryption keys
clearSignKeys [line 1310]
decrypt [line 855]
string decrypt(
string
$encryptedData)
|
|
Decrypts string data 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() or Crypt_GPG::importKeyFile() methods.
Parameters:
decryptAndVerify [line 936]
array decryptAndVerify(
string
$encryptedData)
|
|
Decrypts and verifies string data 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() or Crypt_GPG::importKeyFile() methods.
Parameters:
decryptAndVerifyFile [line 983]
array decryptAndVerifyFile(
string
$encryptedFile, [string
$decryptedFile = null])
|
|
Decrypts and verifies a signed, encrypted file 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() or Crypt_GPG::importKeyFile() methods.
Parameters:
decryptFile [line 898]
void|string decryptFile(
string
$encryptedFile, [string
$decryptedFile = null])
|
|
Decrypts a file 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() or Crypt_GPG::importKeyFile() methods.
Parameters:
deletePrivateKey [line 498]
void deletePrivateKey(
string
$keyId)
|
|
Deletes a private key from the keyring If more than one key fingerprint is available for the specified $keyId (for example, if you use a non-unique uid) only the first private key is deleted. Calls GPG with the --delete-secret-key command.
Parameters:
deletePublicKey [line 427]
void deletePublicKey(
string
$keyId)
|
|
Deletes a public key from the keyring If more than one key fingerprint is available for the specified $keyId (for example, if you use a non-unique uid) only the first public key is deleted. The private key must be deleted first or an exception will be thrown. See Crypt_GPG::deletePrivateKey().
Parameters:
encrypt [line 688]
string encrypt(
string
$data, [boolean
$armor = self::ARMOR_ASCII])
|
|
Encrypts string data Data is ASCII armored by default but may optionally be returned as binary.
Parameters:
encryptAndSign [line 767]
string encryptAndSign(
string
$data, [boolean
$armor = self::ARMOR_ASCII])
|
|
Encrypts and signs data Data is encrypted and signed in a single pass. NOTE: Until GnuPG version 1.4.10, it was not possible to verify encrypted-signed data without decrypting it at the same time. If you try to use Crypt_GPG::verify() method on encrypted-signed data with earlier GnuPG versions, you will get an error. Please use Crypt_GPG::decryptAndVerify() to verify encrypted-signed data.
Parameters:
encryptAndSignFile [line 818]
void|string encryptAndSignFile(
string
$filename, [string
$signedFile = null], [boolean
$armor = self::ARMOR_ASCII])
|
|
Encrypts and signs a file The file is encrypted and signed in a single pass. NOTE: Until GnuPG version 1.4.10, it was not possible to verify encrypted-signed files without decrypting them at the same time. If you try to use Crypt_GPG::verify() method on encrypted-signed files with earlier GnuPG versions, you will get an error. Please use Crypt_GPG::decryptAndVerifyFile() to verify encrypted-signed files.
Parameters:
encryptFile [line 724]
void|string encryptFile(
string
$filename, [string
$encryptedFile = null], [boolean
$armor = self::ARMOR_ASCII])
|
|
Encrypts a file Encrypted data is ASCII armored by default but may optionally be saved as binary.
Parameters:
exportPublicKey [line 360]
string exportPublicKey(
string
$keyId, [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 available for the specified $keyId (for example, if you use a non-unique uid) only the first public key is exported.
Parameters:
getFingerprint [line 605]
string getFingerprint(
string
$keyId, [integer
$format = self::FORMAT_NONE])
|
|
Gets a key fingerprint from the keyring If more than one key fingerprint is available (for example, if you use a non-unique user id) only the first key fingerprint is returned. Calls the GPG --list-keys command with the --with-fingerprint option to retrieve a public key fingerprint.
Parameters:
getKeys [line 567]
array getKeys(
[string
$keyId = ''])
|
|
Gets the available keys in the keyring Calls GPG with the --list-keys command and grabs keys. See the first section of doc/DETAILS in the GPG package for a detailed description of how the GPG command output is parsed.
Parameters:
handleImportKeyStatus [line 1370]
void handleImportKeyStatus(
string
$line,
&$result)
|
|
Handles the status output from GPG for the import operation This method is responsible for building the result array that is returned from the Crypt_GPG::importKey() method. See doc/DETAILS in the GPG distribution for detailed information on GPG's status output.
Parameters:
handleSignStatus [line 1333]
void handleSignStatus(
string
$line)
|
|
Handles the status output from GPG for the sign operation This method is responsible for sending the passphrase commands when required by the Crypt_GPG::sign() method. See doc/DETAILS in the GPG distribution for detailed information on GPG's status output.
Parameters:
importKey [line 285]
importKeyFile [line 324]
sign [line 1032]
string sign(
string
$data, [boolean
$mode = self::SIGN_MODE_NORMAL], [boolean
$armor = self::ARMOR_ASCII], [boolean
$textmode = self::TEXT_RAW])
|
|
Signs data Data may be signed using any one of the three available signing modes:
Parameters:
signFile [line 1096]
void|string signFile(
string
$filename, [string
$signedFile = null], [boolean
$mode = self::SIGN_MODE_NORMAL], [boolean
$armor = self::ARMOR_ASCII], [boolean
$textmode = self::TEXT_RAW])
|
|
Signs a file The file may be signed using any one of the three available signing modes:
Parameters:
verify [line 1142]
array verify(
string
$signedData, [string
$signature = ''])
|
|
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 use a detached signature.
Parameters:
verifyFile [line 1178]
array verifyFile(
string
$filename, [string
$signature = ''])
|
|
Verifies a signed file The Crypt_GPG::decryptFile() method may be used to get the original message if the signed data is not clearsigned and does not use a detached signature.
Parameters:
_addKey [line 1410]
void _addKey(
&$array, boolean
$encrypt, boolean
$sign, mixed
$key, [string
$passphrase = null])
|
|
Adds a key to one of the internal key arrays This handles resolving full key objects from the provided $key value.
Parameters:
_decrypt [line 1746]
void|string _decrypt(
string
$data, boolean
$isFile, string
$outputFile)
|
|
Decrypts data
Parameters:
_decryptAndVerify [line 2276]
array _decryptAndVerify(
string
$data, boolean
$isFile, string
$outputFile)
|
|
Decrypts and verifies encrypted, signed data
Parameters:
_encrypt [line 1640]
void|string _encrypt(
string
$data, boolean
$isFile, string
$outputFile, boolean
$armor)
|
|
Encrypts data
Parameters:
_encryptAndSign [line 2018]
void|string _encryptAndSign(
string
$data, boolean
$isFile, string
$outputFile, boolean
$armor)
|
|
Encrypts and signs data
Parameters:
_importKey [line 1543]
array _importKey(
string
$key, boolean
$isFile)
|
|
Imports a public or private key into the keyring
Parameters:
_setPinEntryEnv [line 1499]
void _setPinEntryEnv(
$keys)
|
|
Sets the PINENTRY_USER_DATA environment variable with the currently added keys and passphrases Keys and pasphrases are stored as an indexed array of associative arrays that is JSON encoded to a flat string. For GnuPG 2.x this is how passphrases are passed. For GnuPG 1.x the environment variable is set but not used.
Parameters:
_sign [line 1864]
void|string _sign(
string
$data, boolean
$isFile, string
$outputFile, boolean
$mode, boolean
$armor, boolean
$textmode)
|
|
Signs data
Parameters:
_verify [line 2155]
array _verify(
string
$data, boolean
$isFile, string
$signature)
|
|
Verifies data
Parameters:
Documentation generated on Wed, 13 Mar 2013 18:30:09 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.
|
|