supported()
supported() : boolean
Is this driver supported?
Returns
boolean —True if supported.
PGP backend that uses the openpgp-php library.
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) : \Horde_Pgp_Key_Private
Generates a private key.
array | $opts | Configuration:
|
The generated private key.
encrypt(string $text, array $keys, array $opts) : \Horde_Pgp_Element_Message
Encrypts text using PGP public keys.
string | $text | The text to be PGP encrypted. |
array | $keys | The list of public keys to encrypt (Horde_Pgp_Element_PublicKey objects). |
array | $opts | Additional options:
|
The encrypted message.
encryptSymmetric(string $text, array $passphrase, array $opts) : \Horde_Pgp_Element_Message
Encrypts text using a PGP symmetric passphrase.
string | $text | The text to be PGP encrypted. |
array | $passphrase | The symmetric passphrase(s). |
array | $opts | Additional options:
|
The encrypted message.
sign(string $text, \Horde_Pgp_Element_PrivateKey $key, integer $mode, array $opts = array()) : mixed
Sign a message using a PGP private key.
string | $text | The text to be PGP signed. |
\Horde_Pgp_Element_PrivateKey | $key | The private key to use for signing. |
integer | $mode | The signing mode. Either 'clear', 'detach', or 'message'. |
array | $opts | Additional options:
|
The signed message.
decrypt(\Horde_Pgp_Element_Message $msg, \Horde_Pgp_Element_PrivateKey $key) : \Horde_Pgp_Element_Message
Decrypts text using a PGP private key.
\Horde_Pgp_Element_Message | $msg | The message to be decrypted. |
\Horde_Pgp_Element_PrivateKey | $key | The private key to use for decryption. |
The decrypted message.
decryptSymmetric(\Horde_Pgp_Element_Message $msg, string $passphrase) : \Horde_Pgp_Element_Message
Decrypts text using a PGP symmetric passphrase.
\Horde_Pgp_Element_Message | $msg | The message to be decrypted. |
string | $passphrase | The symmetric passphrase used to encrypt the data. |
The decrypted message.
verify(\Horde_Pgp_Element $msg, \Horde_Pgp_Element_PublicKey $key) : array
Verifies data using a PGP public key.
\Horde_Pgp_Element | $msg | The text to be verified. |
\Horde_Pgp_Element_PublicKey | $key | Public key used for signing. |
{@see Horde_Pgp#verify()}.
_generateSecretKeyPacket(integer $keylength, string $packet_type) : \OpenPGP_SecretKeyPacket
Generate a RSA secret key (sub)packet.
integer | $keylength | RSA keylength. |
string | $packet_type | Secret key packet to create. |
Secret key packet object.
_encryptPrivateKey(\OpenPGP_SecretKeyPacket $p, \phpseclib\Crypt\RSA $cipher, \OpenPGP_S2K $s2k, string $iv)
Encrypt a secret key packet.
\OpenPGP_SecretKeyPacket | $p | Secret key packet. |
\phpseclib\Crypt\RSA | $cipher | RSA cipher object. |
\OpenPGP_S2K | $s2k | OpenPGP String-to-key object. |
string | $iv | Initial vector. |
_encrypt(mixed $key, mixed $data, array $opts)
Encrypt data.
mixed | $key | The list of public keys used to encrypt or a list of passphrases. |
mixed | $data | The data to be PGP encrypted. |
array | $opts | Additional options:
|