\Horde_Crypt_Pgp_Parse

Provides methods to parse PGP armored text data.

Summary

Methods
Properties
Constants
parse()
parseToPart()
No public properties found
ARMOR_MESSAGE
ARMOR_SIGNED_MESSAGE
ARMOR_PUBLIC_KEY
ARMOR_PRIVATE_KEY
ARMOR_SIGNATURE
ARMOR_TEXT
PGP_ARMOR
SIG_CHARSET
SIG_RAW
No protected methods found
$_armor
N/A
No private methods found
No private properties found
N/A

Constants

ARMOR_MESSAGE

ARMOR_MESSAGE

ARMOR_SIGNED_MESSAGE

ARMOR_SIGNED_MESSAGE

ARMOR_PUBLIC_KEY

ARMOR_PUBLIC_KEY

ARMOR_PRIVATE_KEY

ARMOR_PRIVATE_KEY

ARMOR_SIGNATURE

ARMOR_SIGNATURE

ARMOR_TEXT

ARMOR_TEXT

PGP_ARMOR

PGP_ARMOR

Metadata names for data.

SIG_CHARSET

SIG_CHARSET

SIG_RAW

SIG_RAW

Properties

$_armor

$_armor : array

Strings in armor header lines used to distinguish between the different types of PGP decryption/encryption.

Type

array

Methods

parse()

parse(mixed  $text) : array

Parses a message into text and PGP components.

Parameters

mixed $text

Either the text to parse or a Horde_Stream object.

Returns

array —

An array with the parsed text, returned in blocks of text corresponding to their actual order. Keys:

  - data: (array) The data for each section. Each line has been
          stripped of EOL characters.
  - type: (integer) The type of data contained in block. Valid types
          are the class ARMOR_* constants.

parseToPart()

parseToPart(mixed  $text,   $charset = 'UTF-8') : mixed

Parses an armored message into a Horde_Mime_Part object.

Parameters

mixed $text

Either the text to parse or a Horde_Stream object.

$charset

Returns

mixed —

Either null if no PGP data was found, or a Horde_Mime_Part object. For detached signature data: the full contents of the armored text (data + sig) is contained in the SIG_RAW metadata, and the charset is contained in the SIG_CHARSET metadata, within the application/pgp-signature part.