PHP Class Horde_Pgp_Backend_Openpgp, horde

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.
Inheritance: extends Horde_Pgp_Backend
Datei anzeigen Open project: horde/horde Class Usage Examples

Public Methods

Method Description
__construct ( ) Constructor.
autoload ( ) Autoload necessary libraries.
decrypt ( $msg, $key )
decryptSymmetric ( $msg, $passphrase )
encrypt ( $text, $keys, $opts )
encryptSymmetric ( $text, $passphrase, $opts )
generateKey ( $opts )
sign ( $text, $key, $mode, $opts = [] )
verify ( $msg, $key )

Protected Methods

Method Description
_compressMessageOb ( OpenPGP_Message $msg, integer $algo ) : OpenPGP_Message Compress PGP data, if compression is available.
_encrypt ( mixed $key, mixed $data, array $opts ) Encrypt data.
_encryptPrivateKey ( OpenPGP_SecretKeyPacket $p, phpseclib\Crypt\RSA $cipher, OpenPGP_S2K $s2k, string $iv ) Encrypt a secret key packet.
_generateSecretKeyPacket ( integer $keylength, string $packet_type ) : OpenPGP_SecretKeyPacket Generate a RSA secret key (sub)packet.
_getMessageOb ( mixed $data ) : OpenPGP_Message Create a OpenPGP message object, inserting text data into a literal data packet.

Method Details

__construct() public method

Constructor.
public __construct ( )

_compressMessageOb() protected method

Compress PGP data, if compression is available.
protected _compressMessageOb ( OpenPGP_Message $msg, integer $algo ) : OpenPGP_Message
$msg OpenPGP_Message PGP message.
$algo integer Compression algorithm.
return OpenPGP_Message (Possibly compressed) message.

_encrypt() protected method

Encrypt data.
protected _encrypt ( mixed $key, mixed $data, array $opts )
$key mixed The list of public keys used to encrypt or a list of passphrases.
$data mixed The data to be PGP encrypted.
$opts array Additional options: - cipher: (integer) Cipher algorithm. - compress: (integer) Compression algorithm.

_encryptPrivateKey() protected method

Encrypt a secret key packet.
protected _encryptPrivateKey ( OpenPGP_SecretKeyPacket $p, phpseclib\Crypt\RSA $cipher, OpenPGP_S2K $s2k, string $iv )
$p OpenPGP_SecretKeyPacket Secret key packet.
$cipher phpseclib\Crypt\RSA RSA cipher object.
$s2k OpenPGP_S2K OpenPGP String-to-key object.
$iv string Initial vector.

_generateSecretKeyPacket() protected method

Generate a RSA secret key (sub)packet.
protected _generateSecretKeyPacket ( integer $keylength, string $packet_type ) : OpenPGP_SecretKeyPacket
$keylength integer RSA keylength.
$packet_type string Secret key packet to create.
return OpenPGP_SecretKeyPacket Secret key packet object.

_getMessageOb() protected method

Create a OpenPGP message object, inserting text data into a literal data packet.
protected _getMessageOb ( mixed $data ) : OpenPGP_Message
$data mixed Data.
return OpenPGP_Message Message object.

autoload() public static method

Autoload necessary libraries.
public static autoload ( )

decrypt() public method

public decrypt ( $msg, $key )

decryptSymmetric() public method

public decryptSymmetric ( $msg, $passphrase )

encrypt() public method

public encrypt ( $text, $keys, $opts )

encryptSymmetric() public method

public encryptSymmetric ( $text, $passphrase, $opts )

generateKey() public method

public generateKey ( $opts )

sign() public method

public sign ( $text, $key, $mode, $opts = [] )

verify() public method

public verify ( $msg, $key )