Crypt_GPG
[ class tree: Crypt_GPG ] [ index: Crypt_GPG ] [ all elements ]

Class: Crypt_GPG_DecryptStatusHandler

Source Location: /Crypt_GPG-1.4.0b4/Crypt/GPG/DecryptStatusHandler.php

Class Overview


Status line handler for the decrypt operation


Author(s):

Copyright:

  • 2008-2013 silverorange

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 72]
Status line handler for the decrypt operation

This class is used internally by Crypt_GPG and does not need be used directly. See the Crypt_GPG class for end-user API.

This class is responsible for sending the passphrase commands when required by the Crypt_GPG::decrypt() method. See doc/DETAILS in the GnuPG distribution for detailed information on GnuPG's status output for the decrypt operation.

This class is also responsible for parsing error status and throwing a meaningful exception in the event that decryption fails.



[ Top ]


Class Variables

$badPassphrases = array()

[line 143]

Keys for which the passhprase is incorrect

This contains primary user ids indexed by sub-key id and is used to create helpful exception messages.

  • Access: protected

Type:   array


[ Top ]

$currentSubKey =  ''

[line 105]

The id of the current sub-key used for decryption
  • Access: protected

Type:   string


[ Top ]

$decryptionOkay =  true

[line 116]

Whether or not decryption succeeded

If the message is only signed (compressed) and not encrypted, this is always true. If the message is encrypted, this flag is set to false until we know the decryption succeeded.

  • Access: protected

Type:   boolean


[ Top ]

$engine =  null

[line 98]

Engine used to which passphrases are passed
  • Access: protected

Type:   Crypt_GPG_Engine


[ Top ]

$keys = array()

[line 91]

Keys used to decrypt

The array is of the form:

  1.  array(
  2.    $key_id => array(
  3.      'fingerprint' => $fingerprint,
  4.      'passphrase'  => $passphrase
  5.    )
  6.  );

  • Access: protected

Type:   array


[ Top ]

$missingKeys = array()

[line 154]

Keys that can be used to decrypt the data but are missing from the keychain

This is an array with both the key and value being the sub-key id of the missing keys.

  • Access: protected

Type:   array


[ Top ]

$missingPassphrases = array()

[line 133]

Keys for which the passhprase is missing

This contains primary user ids indexed by sub-key id and is used to create helpful exception messages.

  • Access: protected

Type:   array


[ Top ]

$noData =  false

[line 123]

Whether or not there was no data for decryption
  • Access: protected

Type:   boolean


[ Top ]



Method Detail

__construct (Constructor)   [line 166]

Crypt_GPG_DecryptStatusHandler __construct( Crypt_GPG_Engine $engine, $keys)

Creates a new decryption status handler
  • Access: public

Parameters:

Crypt_GPG_Engine   $engine     the GPG engine to which passphrases are passed.
array   $keys     the decryption keys to use.

[ Top ]

handle   [line 182]

void handle( string $line)

Handles a status line
  • Access: public

Parameters:

string   $line     the status line to handle.

[ Top ]

throwException   [line 267]

void throwException( )

Takes the final status of the decrypt operation and throws an appropriate exception

If decryption was successful, no exception is thrown.

  • Throws: Crypt_GPG_KeyNotFoundException if the private key needed to decrypt the data is not in the user's keyring.
  • Throws: Crypt_GPG_Exception if an unknown or unexpected error occurs. Use the debug option and file a bug report if these exceptions occur.
  • Throws: Crypt_GPG_NoDataException if specified data does not contain GPG encrypted data.
  • Throws: Crypt_GPG_BadPassphraseException if a required passphrase is incorrect or if a required passphrase is not specified. See Crypt_GPG::addDecryptKey().
  • Access: public

[ Top ]


Documentation generated on Wed, 13 Mar 2013 18:30:04 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.