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

Class: Crypt_GPG_DecryptStatusHandler

Source Location: /Crypt_GPG-0.7.0/GPG/DecryptStatusHandler.php

Class Overview


Status line handler for the decrypt operation


Author(s):

Copyright:

  • 2008 silverorange

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 69]
Status line handler for the decrypt operation

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

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



[ Top ]


Class Variables

$badPassphrases = array()

[line 136]

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 102]

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

Type:   string


[ Top ]

$decryptionOkay =  false

[line 109]

Whether or not decryption succeeded
  • Access: protected

Type:   boolean


[ Top ]

$engine =  null

[line 95]

Engine used to which passphrases are passed
  • Access: protected

Type:   Crypt_GPG_Engine


[ Top ]

$keys = array()

[line 88]

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 147]

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 126]

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 116]

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

Type:   boolean


[ Top ]



Method Detail

__construct (Constructor)   [line 159]

Crypt_GPG_DecryptStatusHandler __construct( Crypt_GPG_Engine $engine, array $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 175]

void handle( string $line)

Handles a status line
  • Access: public

Parameters:

string   $line   —  the status line to handle.

[ Top ]

throwException   [line 256]

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 Mon, 11 Mar 2019 15:25:33 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.