Documentation

Horde_Pgp
in package

A framework to interact with the OpenPGP standard (RFC 4880).

Tags
author

Michael Slusarz slusarz@horde.org

author

Jan Schneider jan@horde.org

category

Horde

copyright

2002-2017 Horde LLC

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

Table of Contents

$_backends  : array<string|int, mixed>
List of initialized backends.
$_params  : array<string|int, mixed>
Configuration parameters.
__construct()  : mixed
Constructor.
decrypt()  : Horde_Pgp_Element_Message
Decrypts text using a PGP private key.
decryptSymmetric()  : array<string|int, mixed>
Decrypts text using a PGP symmetric passphrase.
encrypt()  : Horde_Pgp_Element_Message
Encrypts text using PGP public keys.
encryptSymmetric()  : Horde_Pgp_Element_Message
Encrypts text using a PGP symmetric passphrase.
generateKey()  : Horde_Pgp_Key_Private
Generates a private key.
sign()  : Horde_Pgp_Element_Message
Sign data using a PGP private key.
signCleartext()  : Horde_Pgp_Element_SignedMessage
Sign data using a PGP private key, creating cleartext output.
signDetached()  : Horde_Pgp_Element_Signature
Sign data using a PGP private key, returning a detached signature.
verify()  : array<string|int, mixed>
Verifies text using a PGP public key.
verifyDetached()  : mixed
Verifies text using a PGP public key and a detached signature.
_getCipher()  : mixed
TODO
_getCompression()  : mixed
TODO
_getOption()  : mixed
TODO
_getPrivateKey()  : mixed
TODO
_initDrivers()  : mixed
Initialize the backend driver list.
_runInBackend()  : mixed
TODO

Properties

$_backends

List of initialized backends.

protected array<string|int, mixed> $_backends = array()

$_params

Configuration parameters.

protected array<string|int, mixed> $_params

Methods

__construct()

Constructor.

public __construct([array<string|int, mixed> $params = array() ]) : mixed
Parameters
$params : array<string|int, mixed> = array()

Configuration parameters:

  • backends: (array) The explicit list of backend drivers (Horde_Pgp_Backend objects) to use.
Return values
mixed

decryptSymmetric()

Decrypts text using a PGP symmetric passphrase.

public decryptSymmetric(mixed $text, string $passphrase) : array<string|int, mixed>
Parameters
$text : mixed

The text to be decrypted.

$passphrase : string

The symmetric passphrase used to encrypt the data.

Tags
throws
Horde_Pgp_Exception
Return values
array<string|int, mixed>

$data Array of decrypted data. Outer array indicates a message block. Each entry is an array with two array elements: a list of data packets contained in that message block and a list of signature data associated with that block.

encrypt()

Encrypts text using PGP public keys.

public encrypt(string $text, mixed $keys[, array<string|int, mixed> $opts = array() ]) : Horde_Pgp_Element_Message
Parameters
$text : string

The text to be encrypted.

$keys : mixed

The list of public keys to encrypt.

$opts : array<string|int, mixed> = array()

Additional options:

  • cipher: (string) Default symmetric cipher algorithm to use. One of: 3DES, CAST5, AES128, AES192, AES256, Twofish.
  • compress: (string) Default compression to use. One of: NONE, ZIP, ZLIB
Tags
throws
Horde_Pgp_Exception
Return values
Horde_Pgp_Element_Message

The encrypted data.

encryptSymmetric()

Encrypts text using a PGP symmetric passphrase.

public encryptSymmetric(string $text, mixed $passphrase[, array<string|int, mixed> $opts = array() ]) : Horde_Pgp_Element_Message
Parameters
$text : string

The text to be encrypted.

$passphrase : mixed

The symmetric passphrase(s).

$opts : array<string|int, mixed> = array()

Additional options:

  • cipher: (string) Default symmetric cipher algorithm to use. One of: 3DES, CAST5, AES128, AES192, AES256, Twofish.
  • compress: (string) Default compression to use. One of: NONE, ZIP, ZLIB
Tags
throws
Horde_Pgp_Exception
Return values
Horde_Pgp_Element_Message

The encrypted data.

generateKey()

Generates a private key.

public generateKey(string $name, string $email[, array<string|int, mixed> $opts = array() ]) : Horde_Pgp_Key_Private
Parameters
$name : string

Full name.

$email : string

E-mail.

$opts : array<string|int, mixed> = array()

Additional options:

  • comment: (string) Comment.
  • hash: (string) Hash function.
  • expire: (integer) Expiration date (UNIX timestamp).
  • keylength: (integer) Key length.
  • passphrase: (string) Passphrase.
Tags
throws
Horde_Pgp_Exception
Return values
Horde_Pgp_Key_Private

The generated private key.

sign()

Sign data using a PGP private key.

public sign(string $text, mixed $key[, array<string|int, mixed> $opts = array() ]) : Horde_Pgp_Element_Message

Returns message object that contains both the signed data and the signature packet.

Parameters
$text : string

The text to be signed.

$key : mixed

The private key to use for signing (must be decrypted).

$opts : array<string|int, mixed> = array()

Additional options:

  • compress: (string) Default compression to use. One of: NONE, ZIP, ZLIB
  • sign_hash: (string) The hash method to use.
Tags
throws
Horde_Pgp_Exception
Return values
Horde_Pgp_Element_Message

The signed data.

signCleartext()

Sign data using a PGP private key, creating cleartext output.

public signCleartext(string $text, mixed $key[, array<string|int, mixed> $opts = array() ]) : Horde_Pgp_Element_SignedMessage
Parameters
$text : string

The text to be signed.

$key : mixed

The private key to use for signing (must be decrypted).

$opts : array<string|int, mixed> = array()

Additional options:

  • sign_hash: (string) The hash method to use.
Tags
throws
Horde_Pgp_Exception
Return values
Horde_Pgp_Element_SignedMessage

The signed data.

signDetached()

Sign data using a PGP private key, returning a detached signature.

public signDetached(string $text, mixed $key[, array<string|int, mixed> $opts = array() ]) : Horde_Pgp_Element_Signature
Parameters
$text : string

The text to be signed.

$key : mixed

The private key to use for signing (must be decrypted).

$opts : array<string|int, mixed> = array()

Additional options:

  • sign_hash: (string) The hash method to use.
Tags
throws
Horde_Pgp_Exception
Return values
Horde_Pgp_Element_Signature

The detached signature.

verify()

Verifies text using a PGP public key.

public verify(mixed $text, mixed $key) : array<string|int, mixed>
Parameters
$text : mixed

The text to be verified

$key : mixed

The public key used for signing.

Tags
throws
Horde_Pgp_Exception
Return values
array<string|int, mixed>

List of verified packets. Each sub array contains two values: the list of packets verfied by signing and the list of signature packets used to verify.

verifyDetached()

Verifies text using a PGP public key and a detached signature.

public verifyDetached(mixed $text, mixed $sig, mixed $key) : mixed
Parameters
$text : mixed

The text to be verified

$sig : mixed

The detached signature.

$key : mixed

The public key used for signing.

Tags
throws
Horde_Pgp_Exception
Return values
mixed

_getCipher()

TODO

protected _getCipher(mixed $opts, mixed $default) : mixed
Parameters
$opts : mixed
$default : mixed
Return values
mixed

_getCompression()

TODO

protected _getCompression(mixed $opts, mixed $default) : mixed
Parameters
$opts : mixed
$default : mixed
Return values
mixed

_getOption()

TODO

protected _getOption(mixed $opts, mixed $default, mixed $name, mixed $map) : mixed
Parameters
$opts : mixed
$default : mixed
$name : mixed
$map : mixed
Return values
mixed

_getPrivateKey()

TODO

protected _getPrivateKey(mixed $key) : mixed
Parameters
$key : mixed
Return values
mixed

_initDrivers()

Initialize the backend driver list.

protected _initDrivers() : mixed
Return values
mixed

_runInBackend()

TODO

protected _runInBackend(mixed $cmd, mixed $args, mixed $error) : mixed
Parameters
$cmd : mixed
$args : mixed
$error : mixed
Return values
mixed

Search results