IPWorks EDI 2020 macOS Edition

Questions / Feedback?

AS1Sender Module

Properties   Methods   Events   Configuration Settings   Errors  

The AS1Sender component implements an AS1 / EDI-INT client, capable of sending EDI messages over electronic mail.

Syntax

nsoftware.IPWorksEDI.As1sender

Remarks

The AS1Sender component is used to send EDI or other messages over SMTP/S, using the AS1 protocol specified in RFC 3335. The class is also used to retrieve and verify server responses.

A typical AS1 transaction is as follows:

(1) The sender sends an EDI document to the receiver using SMTP or SMTPS. Typically the document will be signed and encrypted (particularly if TLS/SSL is not used). A signed receipt will also be requested.

(2) The receiver decrypts the message and verifies the signature.

(3) The receiver sends a signed receipt back to the client. The signature is over the hash of an MDN, which contains a hash of the received message.

When sending an EDI message, the client should specify, at a minimum, From and SendTo, MailServer, and Data and EDIType. The Send method should then be invoked.

To secure the EDI transmission, the message may be signed and/or encrypted by setting the appropriate certificates. By default, the class will apply message security if the appropriate certificates are specified. To sign the data set SigningCert. To encrypt, set RecipientCerts.

TLS/SSL will also be used if SSLStartMode is set. In case your trading partner is using a self-signed certificate with their mail server it will be necessary to set SSLAcceptServerCert or trap the SSLServerAuthentication event to accept the certificate.

The message may also be compressed by setting CompressionFormat.

To request a receipt, or Message Disposition Notification (MDN), simply set the MDNTo property. The MDN will be returned in a separate email response. The MDNOptions property may be used to customize the request. By default, the class will request a signed MDN over an SHA1 hash.

Validating AS1 MDNs

AS1 MDNs are returned asynchronously in a separate email. Generally MDNs will not be returned immediately.

The class supports the use of the POP/S protocol for receiving e-mail. To receive an MDN, set the MailServer, User, and Password properties, and call Connect. At this point you may search your mailbox using the MailMessage properties; when you have found the appropriate message you should invoke ReadReceipt, which will set MDNReceipt. If the receipt is indeed an MDN it will also be parsed (although not verified) and MessageId will be set. If the message is not an MDN an exception will be thrown.

You should then use the values of From and MessageId to look up your trading partner's certificates, the MDNOptions requested, and the OriginalContentMIC calculated when you sent the original message (you must store this value externally to verify signed receipts). Finally, invoke VerifyReceipt.

Property List


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

AttachmentsCollection of files attached to the current message.
CompressionFormatThe compression format (if any) to use.
ConnectedShows whether the component is connected.
EDIDataThe EDI or other data to be sent.
EncryptionAlgorithmThe algorithm used to encrypt the EDI data.
FirewallA set of properties related to firewall access.
FromThe sender of the original message.
LocalHostThe name of the local host or user-assigned IP interface through which connections are initiated or accepted.
LogDirectoryThe path to a directory for logging.
LogFileThe log file written.
MailMessageCcThe value of the Cc header of the mail message.
MailMessageCountThe number of messages waiting in the mailbox.
MailMessageDateThe message date for the currently selected message.
MailMessageFromThe sender of the mail message.
MailMessageHeadersThe message headers for the currently selected message.
MailMessageNumberThe message number on the incoming mail server.
MailMessageReplyToThe value of the ReplyTo header of the mail message.
MailMessageSizeThe size of the mail message.
MailMessageSubjectThe subject of the mail message.
MailMessageTextThe text of the mail message.
MailMessageToThe recipient of the mail message.
MailMessageUIDThe unique id of the mail message.
MailServerThe address of your mail server.
MDNOptionsUsed to indicate the options requested for the MDN receipt.
MDNReceiptThe MDN receipt returned from the server.
MDNToThe system to which an MDN should be directed.
MessageIdThe Id of the message.
OriginalContentMICThe Message Integrity Check(s) (one-way hash) of the outgoing message.
PasswordThe password for your incoming mail server.
ReceiptSignerCertEncodedThe certificate (PEM/base64 encoded).
ReceiptSignerCertStoreThe name of the certificate store for the client certificate.
ReceiptSignerCertStorePasswordIf the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
ReceiptSignerCertStoreTypeThe type of certificate store for this certificate.
ReceiptSignerCertSubjectThe subject of the certificate used for client authentication.
RecipientCertCountThe number of records in the RecipientCert arrays.
RecipientCertEncodedThe certificate (PEM/base64 encoded).
RecipientCertStoreThe name of the certificate store for the client certificate.
RecipientCertStorePasswordIf the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
RecipientCertStoreTypeThe type of certificate store for this certificate.
RecipientCertSubjectThe subject of the certificate used for client authentication.
SendToThe recipient of the message.
SignatureAlgorithmSignature algorithm to be used in outgoing messages.
SigningCertEncodedThe certificate (PEM/base64 encoded).
SigningCertStoreThe name of the certificate store for the client certificate.
SigningCertStorePasswordIf the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
SigningCertStoreTypeThe type of certificate store for this certificate.
SigningCertSubjectThe subject of the certificate used for client authentication.
SSLAcceptServerCertEncodedThe certificate (PEM/base64 encoded).
SSLCertEncodedThe certificate (PEM/base64 encoded).
SSLCertStoreThe name of the certificate store for the client certificate.
SSLCertStorePasswordIf the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
SSLCertStoreTypeThe type of certificate store for this certificate.
SSLCertSubjectThe subject of the certificate used for client authentication.
SSLServerCertEncodedThe certificate (PEM/base64 encoded).
SSLStartModeDetermines how the component starts the SSL negotiation. By default, SSL will not be used.
SubjectThe subject of the message.
UserThe username for your incoming mail server.

Method List


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

ConfigSets or retrieves a configuration setting.
ConnectConnects to the incoming mail server.
DeleteMessageDeletes the message specified by MailMessageNumber .
DisconnectDisconnects from the incoming mail server.
ProcessQueueSend the messages queued for sending.
QueuePrepares and queues the message to the specified directory.
ReadReceiptReads and parses (but does not verify) an MDN receipt.
ResetResets the state of the control.
SendPrepares and sends the AS1 message.
SetRequestHeaderAllows the user to set or add arbitrary HTTP request headers.
VerifyReceiptVerifies an MDN receipt.

Event List


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

ConnectionStatusFired to indicate changes in connection state.
EndTransferFired when the message text completes transferring.
ErrorInformation about errors during data delivery.
HeaderFired for every message header being retrieved.
LogFired with log information while processing a message.
PITrailTraces the commands sent to the mail server, and the respective replies.
SSLServerAuthenticationFired after the server presents its certificate to the client.
SSLStatusShows the progress of the secure connection.
StartTransferFired when the message text starts transferring (on either a send or receive).
TransferFired while the message text gets transferred to or from MailServer .

Configuration Settings


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

LogFilenameThe base name of the log file.
POPPortThe POP mail port to be used, if different than MailServer.
POPServerThe POP server to be used, if different than MailServer.
SMTPAuthMechanismThe authentication mechanism used to connect to the SMTP server.
SMTPPasswordThe password used for authentication.
SMTPPortThe SMTP mail port to be used, if different than MailServer.
SMTPServerThe SMTP server to be used, if different than MailServer.
SMTPSSLStartModeDetermines how SSL negotiation starts with the SMTP server.
SMTPUserThe user name used for authentication.
LogSSLPacketsControls whether SSL packets are logged when using the internal security API.
OpenSSLCADirThe path to a directory containing CA certificates.
OpenSSLCAFileName of the file containing the list of CA's trusted by your application.
OpenSSLCipherListA string that controls the ciphers to be used by SSL.
OpenSSLPrngSeedDataThe data to seed the pseudo random number generator (PRNG).
ReuseSSLSessionDetermines if the SSL session is reused.
SSLCACertsA newline separated list of CA certificate to use during SSL client authentication.
SSLCheckCRLWhether to check the Certificate Revocation List for the server certificate.
SSLCipherStrengthThe minimum cipher strength used for bulk encryption.
SSLEnabledCipherSuitesThe cipher suite to be used in an SSL negotiation.
SSLEnabledProtocolsUsed to enable/disable the supported security protocols.
SSLEnableRenegotiationWhether the renegotiation_info SSL extension is supported.
SSLIncludeCertChainWhether the entire certificate chain is included in the SSLServerAuthentication event.
SSLNegotiatedCipherReturns the negotiated ciphersuite.
SSLNegotiatedCipherStrengthReturns the negotiated ciphersuite strength.
SSLNegotiatedCipherSuiteReturns the negotiated ciphersuite.
SSLNegotiatedKeyExchangeReturns the negotiated key exchange algorithm.
SSLNegotiatedKeyExchangeStrengthReturns the negotiated key exchange algorithm strength.
SSLNegotiatedVersionReturns the negotiated protocol version.
SSLProviderThe name of the security provider to use.
SSLSecurityFlagsFlags that control certificate verification.
SSLServerCACertsA newline separated list of CA certificate to use during SSL server certificate validation.
TLS12SignatureAlgorithmsDefines the allowed TLS 1.2 signature algorithms when UseInternalSecurityAPI is True.
TLS12SupportedGroupsThe supported groups for ECC.
TLS13KeyShareGroupsThe groups for which to pregenerate key shares.
TLS13SignatureAlgorithmsThe allowed certificate signature algorithms.
TLS13SupportedGroupsThe supported groups for (EC)DHE key exchange.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
UseInternalSecurityAPITells the component whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 macOS Edition - Version 20.0 [Build 8203]