libas2
A pure Javascript/Typescript implementation of the AS2 protocol. This project assumes that it fully implements Applicability Statement 2 (AS2) version 1.0 per RFC 4130. Best effort has been made to achieve tests which cover the different aspects of the RFC, but this is not a certified library. The project does not have access to Drummond certification, which is considered to be the standards body in certifying compatibility with AS2, so good sense should be used when using this library as the AS2 layer in an application.
WARNING
BETA SOFTWARE
This library is not quite yet ready for production use. The API is still in flux, but nearly finished. This will be settled soon to allow for a production version 1.0.0 release. Documentation of the API is complete and work is being done to keep the documentation up-to-date.
Usage
Install it from the npm repository:
npm install --save libas2
Then require it in your project:
const AS2Composer =
The TypeScript code is compiled to JavaScript and distributed via NPM. If you wish to use the TypeScript code directly you can download the zip and unpack it locally.
Then import it in your project:
Features
- Compose AS2 messages to send, including signing and encrypting
- Parse received AS2 messages, including decrypting and verifying
- Generate and consume Message Disposition Notifications; includes convenience methods for incoming and outgoing dispositions
- Complete support for AS2 protocol 1.0 per RFC 4130; see roadmap
- Rich cryptography support based on PKIjs
- Rich MIME support based on Nodemailer and Emailjs
Roadmap
- Finish README for libas2 1.x release
- Write implementation of CMS compression to support AS2 version 1.1 (see rfc4130 section 6.1)
- Support versions of AS2 greater than 1.1
API
See the API documentation for complete information.
Contribute
Help Wanted: Any experience writing test suites for AS2 would be welcome.
Contributions, especially from those familiar with the AS2 protocol, are welcome. If you can improve the code, please fork it and fire off a pull request.
This project uses Standard JS, specifically through prettier-standard
; please format pull requests before submitting to avoid having your contributions incorrectly attributed in the pull request by a code formatting.
Cryptography Notice
This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See http://www.wassenaar.org/ for more information.