PGPProvider Property
The PGP provider provides an interface to the PGP cryptography software.
Syntax
public String getPGPProvider(); public void setPGPProvider(String PGPProvider);
Remarks
Name of the class that interfaces to the PGP cryptography software.
The bean offers two methods for PGP operations. The first is an internal OpenPGP implementation that requires no additional dependencies. This is the default mode of operation. Alternatively a separate provider such as GnuPGP may be used to perform the PGP operations. PGPProviderType specifies which provider to use.
Internal Provider (Default)
When using the internal PGP provider no special steps are required. The following table defines possible values that may be passed to the SetPGPParam.
homedir | The directory containing the public keyring, secret keyring and trust database. Please note this defaults to the application preferences directory of the user, hence if the GNUPG provider is being used from a ASP.NET application, homedir should be specified. |
passphrase | The passphrase to access the secret keys in the secret-keyring. |
userid | The identifier used to identify a secret key within the secret-keyring. Note: When decrypting if this value is not specified the bean will attempt to find the key within the keyring automatically based on information available in the PGP message itself. |
recipient-userid | The identifier used to identify a public key within the public keyring. Note: When verifying a signature if this value is not specified the bean will attempt to find the key within the keyring automatically based on information available in the PGP message itself. |
timeout | The timeout in milliseconds that the provider will wait for a response from the OpenPGP executable. The default is 5000 (5 seconds). |
usetempfile | If set to "true" the provider will write data to be processed to a temporary file on disk. This is useful when working with large files or binary files. |
signingalgorithm | The signing algorithm to use when SignData is True. Possible values are:
|
encryptingalgorithm | The encrypting algorithm to use when EncryptData is True. Possible values are:
|
compressionmethod | The compression method to use. Possible values are:
|
External Provider
The PGP operations may be performed by an external implementation such as GnuPG.
A PGP provider is a simple module that allows the bean to offload PGP operations to the PGP software of your choice. The interface is designed to be generic in its ability to include various PGP software and is limited to only the bare minimum capabilities required for a GISB message exchange. We include a PGP provider implementation for GnuPG which may be used as a reference to implement other providers.
A PGP provider is simply a class that should have the following methods. The bean uses reflection to access the methods of the provider.
public void setParam(String name, String value); public byte[] encrypt(byte[] data); public byte[] decrypt(byte[] data); public byte[] sign(byte[] data); public byte[] signAndEncrypt(byte[] data); public boolean verifySignature(byte[] signature, byte[] signedData);
The following table defines possible values that may be passed to the SetPGPParam.
gpg-path | The path to the OpenPGP executable for the desired implementation. |
homedir | The directory containing the public keyring, secret keyring and trust database. Please note this defaults to the application preferences directory of the user, hence if the GNUPG provider is being used from a ASP.NET application, homedir should be specified. |
passphrase | The passphrase to access the secret keys in the secret-keyring. |
userid | The identifier used to identify a secret key within the secret-keyring. |
recipient-userid | The identifier used to identify a public key within the public keyring. |
timeout | The timeout in milliseconds that the provider will wait for a response from the OpenPGP executable. The default is 5000 (5 seconds). |
usetempfile | If set to "true" the provider will write data to be processed to a temporary file on disk. This is useful when working with large files or binary files. |
The bean expects the encryption to return an ASCII armored output and the signing to compute a detached signature.
Note: GnuPG is the Free Software Foundation's implementation of OpenPGP. It is free software and is recommended by NAESB (in version 1.6 of the EDM specification) for use in GISB/NAESB applications.
GnuPG is not included with this package, so you should download the latest version from http://www.gnupg.org. You might use GnuPG (or other software) to import your trading partners' public keys, and to import or generate a private key for yourself. These operations are outside the scope of this software, so please see the GnuPG documentation for details.
Default Value
""