EDI Integrator 2016 Java Edition
EDI Integrator 2016 Java Edition
Questions / Feedback?

GISBReceiver Bean

Properties   Methods   Events   Configuration Settings   Errors  

The GISBReceiver component is used to process EDI messages and generate receipts.

Syntax

InEDI.Gisbreceiver

Remarks

The GISBReceiver implements server-side processing of EDI messages, as specified in versions 1.4 and 1.6 of the GISB/NAESB specification. It can be used to decrypt and verify incoming messages; in version 1.6, it may additionally be used to generate signed receipts. The bean is designed to be easily incorporated into an HTTP server, and features custom functionality for server environments such as ASP.NET.

Basic Operation

The ProcessRequest method is used to process incoming messages and generate responses. ProcessRequest will parse the form data, determine DataFrom and DataTo, and then attempt to process any signed or encrypted data using PGP.

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.

homedirThe 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.
passphraseThe passphrase to access the secret keys in the secret-keyring.
useridThe 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-useridThe 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.
timeoutThe timeout in milliseconds that the provider will wait for a response from the OpenPGP executable. The default is 5000 (5 seconds).
usetempfileIf 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.
signingalgorithmThe signing algorithm to use when SignData is True. Possible values are:
  • SHA1
  • MD5
  • SHA256 (default)
  • SHA384
  • SHA512
  • SHA224
  • RIPEMD160
encryptingalgorithmThe encrypting algorithm to use when EncryptData is True. Possible values are:
  • CAST5
  • 3DES
  • AES256
  • AES192
  • AES128 (default)
  • BLOWFISH
  • TWOFISH
  • IDEA
compressionmethodThe compression method to use. Possible values are:
  • zip (default)
  • zlib
  • bzip2
  • none

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-pathThe path to the OpenPGP executable for the desired implementation.
homedirThe 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.
passphraseThe passphrase to access the secret keys in the secret-keyring.
useridThe identifier used to identify a secret key within the secret-keyring.
recipient-useridThe identifier used to identify a public key within the public keyring.
timeoutThe timeout in milliseconds that the provider will wait for a response from the OpenPGP executable. The default is 5000 (5 seconds).
usetempfileIf 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.

Finally, the bean will generate a Response which you may send to the client with SendResponse.

The most important part of the Response is the RequestStatus; this property will contain either "ok" or an error message to be returned to the requesting client. By default the bean will accept any post that conforms to the standard. If you want to be more restrictive you should first invoke ParseRequest to determine the sender, check the message security used, and extract the EDI data. If there is a problem you may then set RequestStatus to an error before calling CreateResponse. Please see the RequestStatus property for a list of standard error messages.

If you use version 1.4 of the GISB/NAESB protocol, the response will be a simple HTML reply. If you use version 1.6 the sender has the option of requesting a signed receipt. In all cases the response may be created with CreateResponse and sent with SendResponse.

To create log files, set LogDirectory prior to invoking ProcessRequest. This will log all incoming and outgoing data, and will also write the received EDI files to disk.

Additional Server-Side Functionality

When used in a server environment such as ASP, ASP.NET, etc., the bean may be used to interface directly with the underlying HTTP context. If Request is not set by the user ParseRequest and ProcessRequest will first get the request from the underlying HTTP environment, if possible. SendResponse will send the reply in this environment if able; otherwise the reply will be directed to standard out.

Property List


The following is the full list of the properties of the bean with short descriptions. Click on the links for further details.

DataElementsCollection of data elements for the client's request.
DataFromThe identity of the sending system.
DataToThe identity of the receiving system.
EncryptionTypeThe MIME type of the encrypted data.
ErrorMessageIf the client sent an error notification, the error message.
GISBDataThe EDI Payload of the message.
GISBVersionThe version of the GISB/NAESB protocol used.
LogDirectoryThe path to a directory for logging.
LogFileThe log file written.
PGPProviderThe PGP provider provides an interface to the PGP cryptography software.
ReceiptSigningProtocolThe protocol used to sign the receipt, if any.
ReceiptTypeThe type of receipt to be returned, if any.
RequestThe HTTP request to be processed.
RequestHeadersThe HTTP headers in the request.
RequestStatusThe status of the request.
ResponseThe response generated by the component.
ResponseHeadersThe response headers generated by the component.
ServerIdThe ID of your server.
SignatureTypeThe MIME type of the signature (if any).
TransactionIdThe transaction ID of the message.

Method List


The following is the full list of the methods of the bean with short descriptions. Click on the links for further details.

configSets or retrieves a configuration setting .
createResponseCreates the response.
parseFormDataProcesses the form data, and populates the appropriate properties.
parseRequestProcesses the EDI data.
processRequestProcesses the EDI data, and generates the receipt.
readRequestReads the AS2 request from the given HTTP servlet request.
resetResets the state of the control.
sendResponseIn a server environment, responds to the requesting client.
setPGPParamSets a parameter in the PGP provider.

Event List


The following is the full list of the events fired by the bean with short descriptions. Click on the links for further details.

ErrorInformation about errors during data delivery.
LogFires with log information during processing.

Configuration Settings


The following is a list of configuration settings for the bean with short descriptions. Click on the links for further details.

LogLevelSpecifies the level of detail that is logged.
RequireEncryptionWhether an error should be thrown if an unencrypted message is received.
RequireSignatureWhether an error should be thrown if an unsigned message is received.
TimeCFormatThe format of the Time-C data element.
TimeCQualifierThe UTC off-set of the server.
PGPProviderTypeWhich PGP implementation to use.
LogFilenameThe base name of the log file.
GUIAvailableTells the component whether or not a message loop is available for processing events.
UseDaemonThreadsWhether threads created by the component are daemon threads.
UseInternalSecurityAPITells the component whether or not to use the system security libraries or an internal implementation.

 
 
Copyright (c) 2020 /n software inc. - All rights reserved.
EDI Integrator 2016 Java Edition - Version 16.0 [Build 7362]