- AS2Agreement
Class for describing and handling partner agreements.
- AS2Composer
Class for composing AS2 messages.
- AS2Crypto
Class for cryptography methods supported by AS2.
- PemFile
Method for constructing an object from PEM data.
- AS2Disposition
Class for describing and constructing a Message Disposition Notification.
- AS2DispositionNotification
Class for dealing with disposition notification headers.
- AS2MimeNode
Class for describing and constructing a MIME document.
- AS2Parser
Class for parsing a MIME document to an AS2MimeNode tree.
- PEM_FILETYPE :
object Constants used in libas2.
- AS2Constants :
object Constants used in libas2.
- getReportNode(node) ⇒
AS2MimeNode Get the multipart/report disposition-notification, if any.
- isMdn(node) ⇒
boolean Answers if the AS2MimeNode is a Message Disposition Notification.
- parseHeaderString(headers, [keyToLowerCase], [callback]) ⇒
object Method for converting a string of headers into key:value pairs.
- getProtocol(url) ⇒
string Method for retrieving the protocol of a URL, dynamically.
- isNullOrUndefined(value) ⇒
boolean Convenience method for null-checks.
- isSMime(value) ⇒
boolean Determine if a given string is one of PKCS7 MIME types.
- canonicalTransform(node)
Transforms a payload into a canonical text format per RFC 5751 section 3.1.1.
- getSigningOptions(sign) ⇒
SigningOptions Normalizes certificate signing options.
- getEncryptionOptions(encrypt) ⇒
EncryptionOptions Normalizes encryption options.
- getAgreementOptions(agreement) ⇒
AS2Agreement Normalizes agreement options.
- request(options) ⇒
IncomingMessage Convenience method for making AS2 HTTP/S requests. Makes a POST request by default.
- AS2ComposerOptions :
object Options for composing an AS2 message.
- AgreementOptions :
object Options for composing an AS2 message.
- AS2Signing :
'sha-1'|'sha-256'|'sha-384'|'sha-512' List of supported signing algorithms.
- AS2Encryption :
'des-EDE3-CBC'|'aes128-CBC'|'aes192-CBC'|'aes256-CBC'|'aes128-GCM'|'aes192-GCM'|'aes256-GCM' List of supported encryption algorithms.
- EncryptionOptions :
object Options for encrypting payloads.
- DecryptionOptions :
object Options for decrypting payloads.
- SigningOptions :
object Options for decrypting payloads.
- VerificationOptions :
object Options for decrypting payloads.
- AS2DispositionOptions :
object Options for composing a message disposition notification (MDN).
- OutgoingDispositionOptions :
object Options for generating an outgoing MDN.
- ParseOptions :
object Options for parsing a MIME document; useful if there is no access to the underlying raw response.
Class for describing and handling partner agreements.
Kind: global class
Implements: AgreementOptions
| Param | Type | Description |
|---|---|---|
| agreement | AgreementOptions |
The partner agreement for sending and receiving over AS2. |
Class for composing AS2 messages.
Kind: global class
- AS2Composer
- new AS2Composer(options)
- .setAgreement(agreement)
- .compile() ⇒
Promise.<AS2MimeNode> - .toRequestOptions([url]) ⇒
Promise.<RequestOptions>
| Param | Type | Description |
|---|---|---|
| options | AS2ComposerOptions |
The options for composing AS2 messages. |
Set the agreement for this composer instance.
Kind: instance method of AS2Composer
| Param | Type |
|---|---|
| agreement | AgreementOptions |
aS2Composer.compile() ⇒ Promise.<AS2MimeNode>
Compile the composed message into an instance of AS2MimeNode.
Kind: instance method of AS2Composer
Returns: Promise.<AS2MimeNode> -
This composer instance as an AS2MimeNode.
Create a Node.js-compatible RequestOptions object from the composed message.
Kind: instance method of AS2Composer
Returns: Promise.<RequestOptions> -
This composer instance as request options for Node.js.
| Param | Type | Description |
|---|---|---|
| [url] | string |
Optional: The URL of the AS2 endpoint receiving this AS2 message; will use agreement partner url if not provided. |
Class for cryptography methods supported by AS2.
Kind: global class
- AS2Crypto
- .generateUniqueId() ⇒
string - .decrypt(node, options) ⇒
Promise.<AS2MimeNode> - .encrypt(node, options) ⇒
Promise.<AS2MimeNode> - .verify(node, options, [getDigest]) ⇒
Promise.<(boolean|object)> - .sign(node, options) ⇒
Promise.<AS2MimeNode> - .compress()
- .decompress()
- .generateUniqueId() ⇒
Crux to generate UUID-like random strings
Kind: static method of AS2Crypto
Returns: string -
A UUID-like random string.
AS2Crypto.decrypt(node, options) ⇒ Promise.<AS2MimeNode>
Method to decrypt an AS2MimeNode from a PKCS7 encrypted AS2MimeNode.
Kind: static method of AS2Crypto
Returns: Promise.<AS2MimeNode> -
The decrypted MIME as an AS2MimeNode.
| Param | Type | Description |
|---|---|---|
| node | AS2MimeNode |
The AS2MimeNode to decrypt. |
| options | DecryptionOptions |
Options to decrypt the MIME message. |
AS2Crypto.encrypt(node, options) ⇒ Promise.<AS2MimeNode>
Method to envelope an AS2MimeNode in an encrypted AS2MimeNode.
Kind: static method of AS2Crypto
Returns: Promise.<AS2MimeNode> -
The encrypted MIME as an AS2MimeNode.
| Param | Type | Description |
|---|---|---|
| node | AS2MimeNode |
The AS2MimeNode to encrypt. |
| options | EncryptionOptions |
Options to encrypt the MIME message. |
Method to verify data has not been modified from a signature.
Kind: static method of AS2Crypto
Returns: Promise.<(boolean|object)> -
A boolean or digest object indicating if the message was verified.
| Param | Type | Description |
|---|---|---|
| node | AS2MimeNode |
The AS2MimeNode to verify. |
| options | VerificationOptions |
Options to verify the MIME message. |
| [getDigest] | boolean |
Optional argument to return a message digest if verified instead of a boolean. |
AS2Crypto.sign(node, options) ⇒ Promise.<AS2MimeNode>
Method to sign data against a certificate and key pair.
Kind: static method of AS2Crypto
Returns: Promise.<AS2MimeNode> -
The signed MIME as a multipart AS2MimeNode.
| Param | Type | Description |
|---|---|---|
| node | AS2MimeNode |
The AS2MimeNode to sign. |
| options | EncryptionOptions |
Options to sign the MIME message. |
Not yet implemented; do not use.
Kind: static method of AS2Crypto
Throws:
-
ERROR.NOT_IMPLEMENTED
Not yet implemented; do not use.
Kind: static method of AS2Crypto
Throws:
-
ERROR.NOT_IMPLEMENTED
Method for constructing an object from PEM data.
Kind: global class
| Param | Type | Description |
|---|---|---|
| data | string | Buffer | PemFile |
Data for constructing a PemFile object. |
PemFile.fromDer(data, [type]) ⇒ PemFile
Convenience method for creating a PemFile from a DER/BER Buffer.
Kind: static method of PemFile
Returns: PemFile -
The data as a PemFile object.
| Param | Type | Default | Description |
|---|---|---|---|
| data | Buffer |
DER or BER data in a Buffer. |
|
| [type] | PemFileType |
'UNKNOWN' |
The type of PEM file. |
Class for describing and constructing a Message Disposition Notification.
Kind: global class
- AS2Disposition
- instance
- static
- .outgoing(options) ⇒
Promise.<object> - .incoming(node, [signed]) ⇒
Promise.<AS2Disposition>
- .outgoing(options) ⇒
aS2Disposition.toMimeNode() ⇒ AS2MimeNode
This instance to an AS2MimeNode.
Kind: instance method of AS2Disposition
Returns: AS2MimeNode -
- An MDN as an AS2MimeNode.
Convenience method to decrypt and/or verify a mime node and construct an outgoing message disposition.
Kind: static method of AS2Disposition
Returns: Promise.<object> -
- The content node, disposition object, and the generated outgoing MDN as an AS2MimeNode.
| Param | Type | Description |
|---|---|---|
| options | OutgoingDispositionOptions |
The options for generating an outgoing MDN. |
AS2Disposition.incoming(node, [signed]) ⇒ Promise.<AS2Disposition>
Deconstruct a mime node into an incoming message disposition.
Kind: static method of AS2Disposition
Returns: Promise.<AS2Disposition> -
The incoming message disposition notification.
| Param | Type | Description |
|---|---|---|
| node | AS2MimeNode |
An AS2MimeNode containing an incoming MDN. |
| [signed] | VerificationOptions |
Options for verifying the MDN if necessary. |
Class for dealing with disposition notification headers.
Kind: global class
| Param | Type | Default | Description |
|---|---|---|---|
| [notification] | AS2DispositionNotification |
A raw instance of AS2DispositionNotification. |
|
| [notificationType] | 'incoming' | 'outgoing' |
'outgoing' |
The type of notification; default is 'outgoing'. |
Converts this instance to a plain key/value-pair object.
Kind: instance method of AS2DispositionNotification
Returns: object -
This instance as key/value pairs.
This instance to a string.
Kind: instance method of AS2DispositionNotification
Returns: string -
a raw string instance.
Class for describing and constructing a MIME document.
Kind: global class
- AS2MimeNode
- new AS2MimeNode(options)
- instance
- .setSigning(options)
- .setEncryption(options)
- .setHeader(keyOrHeaders, [value]) ⇒
AS2MimeNode - .messageId([create]) ⇒
string - .dispositionOut([options]) ⇒
Promise.<object> - .dispositionIn([signed]) ⇒
Promise.<AS2Disposition> - .sign([options]) ⇒
Promise.<AS2MimeNode> - .verify(options) ⇒
Promise.<AS2MimeNode> - .decrypt(options) ⇒
Promise.<AS2MimeNode> - .encrypt([options]) ⇒
Promise.<AS2MimeNode> - .build() ⇒
Promise.<Buffer> - .buildObject() ⇒
Promise.<object>
- static
| Param | Type | Description |
|---|---|---|
| options | AS2MimeNodeOptions |
Options for constructing an AS2 message. |
Set the signing options for this instance.
Kind: instance method of AS2MimeNode
| Param | Type | Description |
|---|---|---|
| options | SigningOptions |
Options for signing this AS2 message. |
Set the encryption options for this instance.
Kind: instance method of AS2MimeNode
| Param | Type | Description |
|---|---|---|
| options | EncryptionOptions |
Options for encrypting this AS2 message. |
aS2MimeNode.setHeader(keyOrHeaders, [value]) ⇒ AS2MimeNode
Set one or more headers on this instance.
Kind: instance method of AS2MimeNode
Returns: AS2MimeNode -
This AS2MimeNode instance.
| Param | Type | Description |
|---|---|---|
| keyOrHeaders | string | any |
The key name of the header to set or an array of headers. |
| [value] | string |
The value of the header key; required if providing a simple key/value. |
Sets and/or gets the message ID of the MIME message.
Kind: instance method of AS2MimeNode
Returns: string -
The message ID of the MIME.
| Param | Type | Default | Description |
|---|---|---|---|
| [create] | boolean |
false |
Set the the message ID if one does not exist. |
Convenience method for generating an outgoing MDN for this message.
Kind: instance method of AS2MimeNode
Returns: Promise.<object> -
The content node and the outgoing MDN as an AS2MimeNode.
| Param | Type | Description |
|---|---|---|
| [options] | DispositionOutOptions |
Optional options for generating an MDN. |
aS2MimeNode.dispositionIn([signed]) ⇒ Promise.<AS2Disposition>
Convenience method for consuming this instance as an incoming MDN.
Kind: instance method of AS2MimeNode
Returns: Promise.<AS2Disposition> -
This instance as an incoming AS2Disposition.
| Param | Type | Description |
|---|---|---|
| [signed] | VerificationOptions |
Pass verification options for a signed MDN. |
aS2MimeNode.sign([options]) ⇒ Promise.<AS2MimeNode>
Convenience method for signing this instance.
Kind: instance method of AS2MimeNode
Returns: Promise.<AS2MimeNode> -
This instance as a new signed multipart AS2MimeNode.
| Param | Type | Description |
|---|---|---|
| [options] | SigningOptions |
Options for signing this AS2 message; not required if provided when constructing this instance. |
aS2MimeNode.verify(options) ⇒ Promise.<AS2MimeNode>
Convenience method for verifying this instance.
Kind: instance method of AS2MimeNode
Returns: Promise.<AS2MimeNode> -
The content part of this signed message as an AS2MimeNode.
| Param | Type | Description |
|---|---|---|
| options | VerificationOptions |
Options for verifying this signed AS2 message. |
aS2MimeNode.decrypt(options) ⇒ Promise.<AS2MimeNode>
Convenience method for decrypting this instance.
Kind: instance method of AS2MimeNode
Returns: Promise.<AS2MimeNode> -
The contents of the encrypted message as an AS2MimeNode.
| Param | Type | Description |
|---|---|---|
| options | DecryptionOptions |
Options for decrypting this encrypted AS2 message. |
aS2MimeNode.encrypt([options]) ⇒ Promise.<AS2MimeNode>
Convenience method for encrypting this instance.
Kind: instance method of AS2MimeNode
Returns: Promise.<AS2MimeNode> -
This instance as a new encrypted AS2MimeNode.
| Param | Type | Description |
|---|---|---|
| [options] | EncryptionOptions |
Options for encrypting this AS2 message; not required if provided when constructing this instance. |
Constructs a complete S/MIME or MIME buffer from this instance.
Kind: instance method of AS2MimeNode
Returns: Promise.<Buffer> -
This instance as raw, complete S/MIME or MIME buffer.
Method for getting the headers and body of the MIME message as separate properties.
Kind: instance method of AS2MimeNode
Returns: Promise.<object> -
An object with headers and body properties.
Generates a valid, formatted, random message ID.
Kind: static method of AS2MimeNode
Returns: string -
A valid message ID for use with MIME.
| Param | Type | Default | Description |
|---|---|---|---|
| [sender] | string |
"'<HOST_NAME>'" |
The sender of this ID. |
| [uniqueId] | string |
A unique ID may be provided if a real GUID is required. |
Class for parsing a MIME document to an AS2MimeNode tree.
AS2Parser.parse(content) ⇒ Promise.<AS2MimeNode>
Parse a raw MIME document into an AS2MimeNode.
Kind: static method of AS2Parser
Returns: Promise.<AS2MimeNode> -
The MIME document as an AS2MimeNode.
| Param | Type | Description |
|---|---|---|
| content | Buffer | Stream | string | ParseOptions |
A raw MIME message or ParseOptions object. |
Constants used in libas2.
Kind: global namespace
- PEM_FILETYPE :
object- .CERTIFICATE :
PemFileType - .PRIVATE_KEY :
PemFileType - .PUBLIC_KEY :
PemFileType
- .CERTIFICATE :
Kind: static constant of PEM_FILETYPE
Default: CERTIFICATE
Kind: static constant of PEM_FILETYPE
Default: PRIVATE_KEY
Kind: static constant of PEM_FILETYPE
Default: PUBLIC_KEY
Constants used in libas2.
Kind: global namespace
- AS2Constants :
object- .ENCRYPTION :
object - .ERROR :
object- .MISSING_PARTNER_CERT :
string - .MISSING_PARTNER_KEY :
string - .WRONG_PEM_FILE :
string - .FINAL_RECIPIENT_MISSING :
string - .CONTENT_VERIFY :
string - .CERT_DECRYPT :
string - .DISPOSITION_NODE :
string - .NOT_IMPLEMENTED :
string
- .MISSING_PARTNER_CERT :
- .EXPLANATION :
object- .SUCCESS :
string - .FAILED_DECRYPTION :
string - .FAILED_VERIFICATION :
string - .FAILED_GENERALLY :
string
- .SUCCESS :
- .SIGNING :
object - .STANDARD_HEADER :
object - .CRLF :
string - .MIME_VERSION :
string - .AS2_VERSION :
string - .SMIME_DESC :
string - .SIGNATURE_FILENAME :
string - .ENCRYPTION_FILENAME :
string - .LIBRARY_NAME :
string - .LIBRARY_VERSION :
string - .LIBRAY_NAME_VERSION :
string
- .ENCRYPTION :
Constants used for signing.
Kind: static namespace of AS2Constants
- .ENCRYPTION :
object
ENCRYPTION.AES128_CBC : AS2Encryption
Kind: static constant of ENCRYPTION
Default: aes128-CBC
ENCRYPTION.AES192_CBC : AS2Encryption
Kind: static constant of ENCRYPTION
Default: aes192-CBC
ENCRYPTION.AES256_CBC : AS2Encryption
Kind: static constant of ENCRYPTION
Default: aes256-CBC
ENCRYPTION.AES128_GCM : AS2Encryption
Kind: static constant of ENCRYPTION
Default: aes128-GCM
ENCRYPTION.AES192_GCM : AS2Encryption
Kind: static constant of ENCRYPTION
Default: aes192-GCM
ENCRYPTION.AES256_GCM : AS2Encryption
Kind: static constant of ENCRYPTION
Default: aes256-GCM
Constants used for signing.
Kind: static namespace of AS2Constants
- .ERROR :
object- .MISSING_PARTNER_CERT :
string - .MISSING_PARTNER_KEY :
string - .WRONG_PEM_FILE :
string - .FINAL_RECIPIENT_MISSING :
string - .CONTENT_VERIFY :
string - .CERT_DECRYPT :
string - .DISPOSITION_NODE :
string - .NOT_IMPLEMENTED :
string
- .MISSING_PARTNER_CERT :
Kind: static constant of ERROR
Default: "Certificate is required for this partner agreement."
Kind: static constant of ERROR
Default: "Private key is required for this partner agreement."
Kind: static constant of ERROR
Default: "The type of pem file provided was not correct;"
Kind: static constant of ERROR
Default: "AS2 message is missing the AS2-To header, so there is no final recipient which is required."
Kind: static constant of ERROR
Default: "Could not verify signature against contents."
Kind: static constant of ERROR
Default: "Certificate provided was not used to encrypt message."
Kind: static constant of ERROR
Default: "Mime node must be provided in order to create outgoing disposition."
Kind: static constant of ERROR
Default: "NOT YET IMPLEMENTED!"
Constants used for signing.
Kind: static namespace of AS2Constants
- .EXPLANATION :
object- .SUCCESS :
string - .FAILED_DECRYPTION :
string - .FAILED_VERIFICATION :
string - .FAILED_GENERALLY :
string
- .SUCCESS :
Kind: static constant of EXPLANATION
Default: "The message was received successfully. This is no guarantee that the message contents have been processed."
Kind: static constant of EXPLANATION
Default: "The message was received, but could not be decrypted; the contents cannot be processed."
Kind: static constant of EXPLANATION
Default: "The message was received, but could not be verified; the contents cannot be trusted to be the same contents that were sent."
Kind: static constant of EXPLANATION
Default: "The message could not be received or processed."
Constants used for signing.
Kind: static namespace of AS2Constants
- .SIGNING :
object
SIGNING.SHA1 : AS2Signing
Kind: static constant of SIGNING
Default: sha-1
SIGNING.SHA256 : AS2Signing
Kind: static constant of SIGNING
Default: sha-256
SIGNING.SHA384 : AS2Signing
Kind: static constant of SIGNING
Default: sha-384
SIGNING.SHA512 : AS2Signing
Kind: static constant of SIGNING
Default: sha-512
Constants used for signing.
Kind: static namespace of AS2Constants
- .STANDARD_HEADER :
object
Kind: static constant of STANDARD_HEADER
Default: "AS2-Version"
Kind: static constant of STANDARD_HEADER
Default: "AS2-To"
Kind: static constant of STANDARD_HEADER
Default: "AS2-From"
Kind: static constant of STANDARD_HEADER
Default: "Disposition-Notification-To"
Kind: static constant of STANDARD_HEADER
Default: "Disposition-Notification-Options"
Kind: static constant of STANDARD_HEADER
Default: "Receipt-Delivery-Option"
Kind: static constant of AS2Constants
Default: "\r\n"
Kind: static constant of AS2Constants
Default: "1.0"
Kind: static constant of AS2Constants
Default: "1.0"
Kind: static constant of AS2Constants
Default: "This is an S/MIME signed message"
Kind: static constant of AS2Constants
Default: "smime.p7s"
Kind: static constant of AS2Constants
Default: "smime.p7m"
Kind: static constant of AS2Constants
Kind: static constant of AS2Constants
Kind: static constant of AS2Constants
getReportNode(node) ⇒ AS2MimeNode
Get the multipart/report disposition-notification, if any.
Kind: global function
Returns: AS2MimeNode -
The multipart/report disposition-notification.
| Param | Type | Description |
|---|---|---|
| node | AS2MimeNode |
The multipart MIME containing the report. |
Answers if the AS2MimeNode is a Message Disposition Notification.
Kind: global function
Returns: boolean -
True for a Message Disposition Notification.
| Param | Type | Description |
|---|---|---|
| node | AS2MimeNode |
The multipart MIME which may contain a report. |
Method for converting a string of headers into key:value pairs.
Kind: global function
Returns: object -
The headers as an object of key/value pairs.
| Param | Type | Default | Description |
|---|---|---|---|
| headers | string |
A string of headers. |
|
| [keyToLowerCase] | boolean | function |
false |
Set all header keys to lower-case; or provide a function to manipulate values. |
| [callback] | function |
A callback to manipulate values as they are parsed; only use if second argument is a boolean. |
Method for retrieving the protocol of a URL, dynamically.
Kind: global function
Returns: string -
The protocol of the URL.
Throws:
-
URL is not one of either "string" or instance of "URL".
| Param | Type | Description |
|---|---|---|
| url | string | URL |
The url to get the protocol. |
Convenience method for null-checks.
Kind: global function
Returns: boolean -
True if null or undefined.
| Param | Type | Description |
|---|---|---|
| value | any |
Any value to duck-check. |
Determine if a given string is one of PKCS7 MIME types.
Kind: global function
Returns: boolean -
True if a valid pkcs7 value.
| Param | Type | Description |
|---|---|---|
| value | string |
Checks if either pkcs7 or x-pkcs7. |
Transforms a payload into a canonical text format per RFC 5751 section 3.1.1.
Kind: global function
| Param | Type | Description |
|---|---|---|
| node | AS2MimeNode |
The AS2MimeNode to canonicalize. |
getSigningOptions(sign) ⇒ SigningOptions
Normalizes certificate signing options.
Kind: global function
Returns: SigningOptions -
A normalized option object.
| Param | Type | Description |
|---|---|---|
| sign | SigningOptions |
Options for signing. |
getEncryptionOptions(encrypt) ⇒ EncryptionOptions
Normalizes encryption options.
Kind: global function
Returns: EncryptionOptions -
A normalized option object.
| Param | Type | Description |
|---|---|---|
| encrypt | EncryptionOptions |
Options for encryption. |
getAgreementOptions(agreement) ⇒ AS2Agreement
Normalizes agreement options.
Kind: global function
Returns: AS2Agreement -
A normalized option object.
| Param | Type | Description |
|---|---|---|
| agreement | AgreementOptions |
Options for partner agreement. |
Convenience method for making AS2 HTTP/S requests. Makes a POST request by default.
Kind: global function
Returns: IncomingMessage -
The incoming message, including Buffer properties rawBody and rawResponse, and convenience methods for mime() and json().
| Param | Type | Description |
|---|---|---|
| options | RequestOptions |
Options for making a request; extends Node's RequestOptions interface. |
| options.body | Buffer | string | object | Array |
Buffer, string, or JavaScript object. |
| options.params | object |
JavaScript object of parameters to append to the url. |
Options for composing an AS2 message.
Kind: global typedef
Properties
| Name | Type |
|---|---|
| message | AS2MimeNodeOptions |
| agreement | AgreementOptions |
Options for composing an AS2 message.
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| host | object |
Options for the AS2 host. |
| host.name | string |
The name of the host. |
| host.id | string |
The id of the host; usually a company's DUNS id. |
| host.url | string | URL |
The URL of the host's AS2 endpoint. |
| [host.certificate] | string | Buffer | PemFile |
The certificate of the host in PEM format. Required for signing or decrypting. |
| [host.privateKey] | string | Buffer | PemFile |
The private key of the host in PEM format. Required for signing or decrypting. |
| host.decrypt | boolean |
Host requires partner to encrypt messages sent to the host. |
| host.sign | AS2Signing | boolean |
Host requires partner to verify messages sent from the host. |
| [host.mdn] | object |
Host requests a message disposition notification (MDN). |
| host.mdn.async | boolean |
Host requires MDN to be sent to a separate URL. |
| host.mdn.signing | AS2Signing | false |
Host requires MDN to be signed with algorithm if possible. |
| partner | object |
Options for the AS2 partner. |
| partner.name | string |
The name of the partner. |
| partner.id | string |
The id of the partner; usually a company's DUNS id. |
| partner.url | string | URL |
The URL of the partner's AS2 endpoint. |
| partner.file | 'EDIX12' | 'EDIFACT' | 'XML' | string |
The file protocol for trading with the partner. |
| [partner.certificate] | string | Buffer | PemFile |
The certificate of the partner in PEM format. Required for signing or decrypting. |
| partner.encrypt | AS2Encryption | boolean |
Partner requires host to encrypt messages sent to the partner. |
| partner.verify | boolean |
Partner requires host to verify messages sent from the partner. |
| [partner.mdn] | object |
Partner may request a message disposition notification (MDN). |
| partner.mdn.async | boolean |
Partner requires MDN to be sent to a separate URL. |
| partner.mdn.signing | AS2Signing | false |
Partner requires MDN to be signed with algorithm if possible. |
List of supported signing algorithms.
AS2Encryption : 'des-EDE3-CBC' | 'aes128-CBC' | 'aes192-CBC' | 'aes256-CBC' | 'aes128-GCM' | 'aes192-GCM' | 'aes256-GCM'
List of supported encryption algorithms.
Options for encrypting payloads.
Kind: global typedef
Properties
| Name | Type |
|---|---|
| cert | string | Buffer |
| encryption | AS2Encryption |
Options for decrypting payloads.
Kind: global typedef
Properties
| Name | Type |
|---|---|
| cert | string | Buffer |
| key | string | Buffer |
Options for decrypting payloads.
Kind: global typedef
Properties
| Name | Type |
|---|---|
| cert | string | Buffer |
| key | string | Buffer |
| algorithm | AS2Signing |
Options for decrypting payloads.
Kind: global typedef
Properties
| Name | Type |
|---|---|
| cert | string | Buffer |
Options for composing a message disposition notification (MDN).
Kind: global typedef
Properties
| Name | Type |
|---|---|
| explanation | string |
| notification | AS2DispositionNotification |
| [returned] | AS2MimeNode | boolean |
Options for generating an outgoing MDN.
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| node | AS2MimeNode |
The mime node to verify and/or decrypt; used construct the outgoing disposition. |
| agreement | AgreementOptions |
The partner agreement to use when sending the outgoing disposition. |
| [returnNode] | boolean |
Whether to attach the mime node to the disposition as the returned payload. |
Options for parsing a MIME document; useful if there is no access to the underlying raw response.
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| headers | Array.<string> | object |
Either an object like Node.js |
| content | Buffer | Stream | string |
The raw body of the MIME document. |