Emmanuel.Cryptography.GnuPG.GnuPGWrapper Class
This class is a wrapper class for GNU Privacy Guard (GnuPG). It execute the command line program (gpg.exe) in an different process, redirects standard input (stdin), standard output (stdout) and standard error (stderr) streams, and monitors the streams to fetch the results of the encryption/signing operation.

Please note that you must have INSTALLED GnuPG AND generated/imported the appropriate keys before using this class.

GnuPG stands for GNU Privacy Guard and is GNU's tool for secure communication and data storage. It can be used to encrypt data and to create digital signatures. It includes an advanced key management facility and is compliant with the proposed OpenPGP Internet standard as described in RFC 2440. As such, GnuPG is a complete and free replacement for PGP.

This class has been developed and tested with GnuPG v1.2.0 (MingW32)

For more about GNU, please refer to http://www.gnu.org
For more about GnuPG, please refer to http://www.gnupg.org
For more about OpenPGP (RFC 2440), please refer to http://www.gnupg.org/rfc2440.html

Access: Public
Base Classes: Object
  Members Description  
    GnuPGWrapper Default constructor

 
    GnuPGWrapper Constructor

 
    command Command property: set the type of command to execute (sign, encrypt...)

Defaults to SignAndEncrypt.

 
    armor Boolean flag: if true, GnuPG creates ASCII armored output (text output).

Defaults to true (ASCII ouput).

 
    recipient Recipient email address - mandatory when command is Encrypt or SignAndEncrypt

GnuPG uses this parameter to find the associated public key. You must have imported this public key in your keyring before.

 
    originator Originator email address - recommended when command is Sign or SignAndEncrypt

GnuPG uses this parameter to find the associated secret key. You must have imported this secret key in your keyring before. Otherwise, GnuPG uses the first secret key in your keyring to sign messages. This property is mapped to the "--default-key" option.

 
    yes Boolean flag; if true, GnuPG assumes "yes" on most questions.

Defaults to true.

 
    batch Boolean flag; if true, GnuPG uses batch mode (Never ask, do not allow interactive commands).

Defaults to true.

 
    passphrase Passphrase for using your private key - mandatory when command is Sign or SignAndEncrypt.

 
    homedirectory name of the home directory (where keyrings AND gpg.exe are located)

 
    passphrasefd File descriptor for entering passphrase - defaults to 0 (standard input).

 
    exitcode Exit code from GnuPG process (0 = success; otherwise an error occured)

 
    verbose Verbose level (NoVerbose, Verbose, VeryVerbose).

Defaults to NoVerbose.

 
    ProcessTimeOutMilliseconds Timeout for GnuPG process, in milliseconds.

If the process doesn't exit before the end of the timeout period, the process is terminated (killed).

Defaults to 10000 (10 seconds).

 
    BuildOptions Generate a string of GnuPG command line arguments, based on the properties set in this object (e.g. if the armor property is true, this method generates the "--armor" argument).

 
    ExecuteCommand Execute the GnuPG command defined by all parameters/options/properties.

Raise a GnuPGException whenever an error occurs.

 
    StandardOutputReader Reader thread for standard output

Updates the private variable _outputString (locks it first)

 
    StandardErrorReader Reader thread for standard error

Updates the private variable _errorString (locks it first)

 
    _command    
    _armor    
    _yes    
    _recipient    
    _homedirectory    
    _bindirectory    
    _passphrase    
    _passphrasefd    
    _verbose    
    _batch    
    _originator    
    _ProcessTimeOutMilliseconds    
    _exitcode    
    _processObject    
    _outputString    
    _errorString