Horde_Pgp_Element_PrivateKey
extends Horde_Pgp_Element_Key
in package
PGP element: private key.
Tags
Table of Contents
- REVOKE_COMPROMISED = 2
- REVOKE_NOTUSED = 4
- REVOKE_RETIRED = 3
- REVOKE_SUPERSEDED = 1
- REVOKE_UNKNOWN = 0
- Revocation reasons.
- $armorVersion : string
- Armor header identifying the current software version.
- $encrypted : bool
- $fingerprint : string
- $headers : array<string|int, mixed>
- Armor headers.
- $id : string
- $message : OpenPGP_Message
- Message object.
- $_armor : mixed
- $_cache : array<string|int, mixed>
- Cached data.
- __construct() : mixed
- Constructor.
- __get() : mixed
- __toString() : mixed
- containsEmail() : bool
- Does this key contain an e-mail address?
- create() : Horde_Pgp_Element
- Creates the element from the first found armor part of the class type in the armored input data.
- getEncryptKeys() : array<string|int, mixed>
- Return the list of verified encryption subkeys in this key.
- getFingerprints() : array<string|int, mixed>
- Return the list of key fingerprints.
- getPublicKey() : Horde_Pgp_Element_PublicKey
- Return the public key.
- getSignKeys() : array<string|int, mixed>
- Returns the list of signing subkeys within this key.
- getUnencryptedKey() : Horde_Pgp_Element_PrivateKey
- Return the unencrypted version of the private key.
- getUserIds() : array<string|int, mixed>
- Returns the list of user ID information associated with this key.
- _getSecretKeyPackets() : array<string|int, mixed>
- Return the secret key packet.
- _parse() : mixed
- Parse the message data, verifying the key contents.
- _parseCreation() : mixed
- _parseRevokePacket() : mixed
- _parseVerify() : mixed
Constants
REVOKE_COMPROMISED
public
mixed
REVOKE_COMPROMISED
= 2
REVOKE_NOTUSED
public
mixed
REVOKE_NOTUSED
= 4
REVOKE_RETIRED
public
mixed
REVOKE_RETIRED
= 3
REVOKE_SUPERSEDED
public
mixed
REVOKE_SUPERSEDED
= 1
REVOKE_UNKNOWN
Revocation reasons.
public
mixed
REVOKE_UNKNOWN
= 0
Properties
$armorVersion
Armor header identifying the current software version.
public
string
$armorVersion
= 'Horde_Pgp Library (http://www.horde.org/)'
$encrypted
public
bool
$encrypted
Returns true if the private key is encrypted.
$fingerprint read-only
public
string
$fingerprint
Fingerprint of the base key.
$headers
Armor headers.
public
array<string|int, mixed>
$headers
$id read-only
public
string
$id
ID of the base key.
$message
Message object.
public
OpenPGP_Message
$message
$_armor
protected
mixed
$_armor
= 'PRIVATE KEY BLOCK'
$_cache
Cached data.
protected
array<string|int, mixed>
$_cache
Methods
__construct()
Constructor.
public
__construct(mixed $data[, array<string|int, mixed> $headers = array() ]) : mixed
Parameters
- $data : mixed
-
Data of the part. Either raw PGP data or a OpenPGP_Message object.
- $headers : array<string|int, mixed> = array()
-
Header array.
Return values
mixed —__get()
public
__get(mixed $name) : mixed
Parameters
- $name : mixed
Return values
mixed —__toString()
public
__toString() : mixed
Return values
mixed —containsEmail()
Does this key contain an e-mail address?
public
containsEmail(mixed $email) : bool
Parameters
- $email : mixed
Return values
bool —True if the key contains the e-mail address.
create()
Creates the element from the first found armor part of the class type in the armored input data.
public
static create(mixed $data) : Horde_Pgp_Element
Parameters
- $data : mixed
-
Armored PGP data.
Return values
Horde_Pgp_Element —PGP element object.
getEncryptKeys()
Return the list of verified encryption subkeys in this key.
public
getEncryptKeys() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of objects, with these keys:
- created: (DateTime) Creation time.
- fingerprint: (string) Key fingerprint.
- id: (string) Key ID.
- key: (OpenPGP_PublicKeyPacket) Key packet.
- revoke: (object) Revocation information. Elements:
- created: (DateTime) Creation time.
- info: (string) Human readable reason string.
- reason: (integer) Revocation reason.
getFingerprints()
Return the list of key fingerprints.
public
getFingerprints() : array<string|int, mixed>
Return values
array<string|int, mixed> —Keys are key IDs; values are fingerprints.
getPublicKey()
Return the public key.
public
getPublicKey() : Horde_Pgp_Element_PublicKey
Return values
Horde_Pgp_Element_PublicKey —Public key.
getSignKeys()
Returns the list of signing subkeys within this key.
public
getSignKeys() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of objects, with these keys:
- created: (DateTime) Creation time.
- fingerprint: (string) Key fingerprint.
- id: (string) Key ID.
- key: (OpenPGP_PublicKeyPacket) Key packet.
- revoke: (object) Revocation information. Elements:
- created: (DateTime) Creation time.
- info: (string) Human readable reason string.
- reason: (integer) Revocation reason.
getUnencryptedKey()
Return the unencrypted version of the private key.
public
getUnencryptedKey([string $passphrase = null ]) : Horde_Pgp_Element_PrivateKey
Parameters
- $passphrase : string = null
-
The passphrase used to encrypt the key.
Tags
Return values
Horde_Pgp_Element_PrivateKey —Unencrypted key.
getUserIds()
Returns the list of user ID information associated with this key.
public
getUserIds() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of objects, with these keys:
- comment: (string) Comment.
- created: (DateTime) Creation time.
- email: (Horde_Mail_Rfc822_Address) E-mail address.
- key: (OpenPGP_PublicKeyPacket) Key packet.
- revoke: (object) Revocation information. Elements:
- created: (DateTime) Creation time.
- info: (string) Human readable reason string.
- reason: (integer) Revocation reason.
- sig: (OpenPGP_SignaturePacket) Signature packet.
_getSecretKeyPackets()
Return the secret key packet.
protected
_getSecretKeyPackets() : array<string|int, mixed>
Return values
array<string|int, mixed> —Packet ID as keys, OpenPGP_SecretKeyPacket objects as values.
_parse()
Parse the message data, verifying the key contents.
protected
_parse() : mixed
Return values
mixed —_parseCreation()
protected
_parseCreation(mixed $p) : mixed
Parameters
- $p : mixed
Return values
mixed —_parseRevokePacket()
protected
_parseRevokePacket(mixed $p) : mixed
Parameters
- $p : mixed
Return values
mixed —_parseVerify()
protected
_parseVerify(mixed $key, mixed $data, mixed $sig) : mixed
Parameters
- $key : mixed
- $data : mixed
- $sig : mixed