$_gnupg
$_gnupg : array
GnuPG program location/common options.
PGP backend that uses the gnupg binary.
NOTE: This class is NOT intended to be accessed outside of this package. There is NO guarantees that the API of this class will not change across versions.
generateKey(array $opts) : mixed
Generates a personal public/private keypair combination.
array | $opts | Configuration:
|
False on error; an array on success consisting of the following keys/values:
encryptMessage(string $text, array $params) : string
Encrypts a message in PGP format using a public key.
string | $text | The text to be encrypted. |
array | $params | The parameters needed for encryption.
|
The encrypted message.
encryptSignature(string $text, array $params) : string
Signs a message in PGP format using a private key.
string | $text | The text to be signed. |
array | $params | The parameters needed for signing.
|
The signed message.
decryptMessage(string $text, array $params) : object
Decrypts an PGP encrypted message using a private/public keypair and a passhprase.
string | $text | The text to be decrypted. |
array | $params | The parameters needed for decryption.
|
An object with the following properties:
decryptSignature(string $text, array $params) : object
Decrypts an PGP signed message using a public key.
string | $text | The text to be verified. |
array | $params | The parameters needed for verification.
|
An object with the following properties:
_callGpg(array $options, string $mode, array $input = array(), boolean $output = false, boolean $stderr = false, boolean $parseable = false, boolean $verbose = false) : \stdClass
Function that handles interfacing with the GnuPG binary.
array | $options | Options and commands to pass to GnuPG. |
string | $mode | 'r' to read from stdout, 'w' to write to stdin. |
array | $input | Input to write to stdin. |
boolean | $output | Collect and store output in object returned? |
boolean | $stderr | Collect and store stderr in object returned? |
boolean | $parseable | Is parseable output required? The gpg binary would be executed with C locale then. |
boolean | $verbose | Run GnuPG with verbose flag? |
Class with members output, stderr, and stdout.
_checkSignatureResult(string $result, string $message = null) : object
Checks signature result from the GnuPG binary.
string | $result | The signature result. |
string | $message | The decrypted message data. |
See decryptSignature().
_putInKeyring(mixed $keys = array(), string $type = 'public') : string
Adds PGP keys to the keyring.
mixed | $keys | A single key or an array of key(s) to add to the keyring. |
string | $type | The type of key(s) to add. 'public' or 'private'. |
Command line keystring option to use with gpg program.
_createTempFile(string $descrip = 'horde-crypt', boolean $delete = true) : string
Create a temporary file that will be deleted at the end of this process.
string | $descrip | Description string to use in filename. |
boolean | $delete | Delete the file automatically? |
Filename of a temporary file.