Class: Crypt_GPG
Source Location: /Crypt_GPG-1.6.4/Crypt/GPG.php
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
addDecryptKey [line 1197]
Crypt_GPG addDecryptKey(
mixed
$key, [string
$passphrase = null])
|
|
Adds a key to use for decryption
Parameters:
addEncryptKey [line 1221]
Adds a key to use for encryption
Parameters:
addPassphrase [line 1273]
Crypt_GPG addPassphrase(
mixed
$key, string
$passphrase)
|
|
Register a private key passphrase for import/export (GnuPG 2.1)
Parameters:
addSignKey [line 1249]
Crypt_GPG addSignKey(
mixed
$key, [string
$passphrase = null])
|
|
Adds a key to use for signing
Parameters:
clearDecryptKeys [line 1290]
Clears all decryption keys
clearEncryptKeys [line 1307]
Clears all encryption keys
clearPassphrases [line 1342]
Clears all private key passphrases
clearSignKeys [line 1324]
decrypt [line 831]
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 917]
array decryptAndVerify(
string
$encryptedData, [boolean
$ignoreVerifyErrors = false])
|
|
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 969]
array decryptAndVerifyFile(
string
$encryptedFile, [string
$decryptedFile = null], [boolean
$ignoreVerifyErrors = false])
|
|
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 874]
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 448]
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. In GnuPG >= 2.1 this limitation does not exist. See Crypt_GPG::deletePrivateKey().
Parameters:
encrypt [line 664]
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 743]
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 794]
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 700]
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:
exportPrivateKey [line 374]
string exportPrivateKey(
string
$keyId, [boolean
$armor = true])
|
|
Exports a private key from the keyring The exported key remains on the keyring. To delete the key, use Crypt_GPG::deletePrivateKey(). 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 exported.
Parameters:
exportPublicKey [line 410]
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 585]
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 547]
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:
getLastSignatureInfo [line 634]
Get information about the last signature that was created.
getWarnings [line 1382]
Get list of GnuPG warnings collected on last operation.
hasEncryptKeys [line 1356]
boolean hasEncryptKeys(
)
|
|
Tell if there are encryption keys registered
hasSignKeys [line 1369]
Tell if there are signing keys registered
importKey [line 291]
importKeyFile [line 334]
sign [line 1018]
string sign(
string
$data, [int
$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 1082]
void|string signFile(
string
$filename, [string
$signedFile = null], [int
$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 1131]
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 1170]
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
&$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 1685]
void|string _decrypt(
string
$data, boolean
$isFile, string
$outputFile)
|
|
Decrypts data
Parameters:
_decryptAndVerify [line 1976]
array _decryptAndVerify(
string
$data, boolean
$isFile, string
$outputFile, [boolean
$ignoreVerifyErrors = false])
|
|
Decrypts and verifies encrypted, signed data
Parameters:
_encrypt [line 1626]
void|string _encrypt(
string
$data, boolean
$isFile, string
$outputFile, boolean
$armor)
|
|
Encrypts data
Parameters:
_encryptAndSign [line 1833]
void|string _encryptAndSign(
string
$data, boolean
$isFile, string
$outputFile, boolean
$armor)
|
|
Encrypts and signs data
Parameters:
_exportKey [line 1573]
string _exportKey(
string
$keyId, [boolean
$armor = true], [boolean
$private = false])
|
|
Exports a private or 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 key is exported.
Parameters:
_importKey [line 1517]
array _importKey(
string
$key, boolean
$isFile)
|
|
Imports a public or private key into the keyring
Parameters:
_prepareInput [line 2014]
void _prepareInput(
string
$data, [boolean
$isFile = false], [boolean
$allowEmpty = true])
|
|
Prepares command input
Parameters:
_prepareOutput [line 2052]
void _prepareOutput(
string
$outputFile, [boolean
$input = null])
|
|
Prepares command output
Parameters:
_sign [line 1748]
void|string _sign(
string
$data, boolean
$isFile, string
$outputFile, int
$mode, boolean
$armor, boolean
$textmode)
|
|
Signs data
Parameters:
_verify [line 1901]
array _verify(
string
$data, boolean
$isFile, string
$signature)
|
|
Verifies data
Parameters:
Documentation generated on Sun, 22 Mar 2020 08:01:07 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|