📜 ⬆️ ⬇️

PKI (Public Key Infrastructure) using javascript? This is now possible using the PKIjs and ASN1js libraries.

I present to your attention two libraries that implement almost the full range of the required functionality for organizing a PKI infrastructure: PKIjs and the auxiliary library ASN1js. Libraries are free available and distributed under a license that allows you to use their code without special restrictions, even in commercial products. The full code for these libraries is available on GitHub: PKIjs + ASN1js .

In order to attract readers right in the introduction I will give a short list of features of the above-mentioned libraries:
  1. Object oriented code;
  2. Working with HTML5 (ArrayBuffer, Promises, WebCrypto (using Google Chrome's “dev nightly build”));
  3. The ability to create, verify, receive internal data, change data for the following objects:
    1. X.509 Certificates
    2. Review Lists (CRL) X.509
    3. Certificate Requests (PKCS # 10)
    4. OCSP requests;
    5. OCSP server responses
    6. Time-stamping (TSP) requests
    7. TSP server responses
    8. CMS Signed Data
    9. CMS Enveloped Data

  4. Implementing your own “certificate chain validation engine” in JavaScript;
  5. … And much more! Look under the cut!


More information about libraries and what you can do with them.
')

ASN1js


The ASN1js library is an ASN.1 BER data encoder / decoder (Basic Encoding Rules), that is, it automatically allows you to work with the DER and CER rule sets as well. In addition to data coding / decoding, the library also allows you to create objects that are easy to understand ASN.1 diagrams, and also to compare ASN.1 BER decoded data with previously made diagrams.

I will list the set of features of this library:


There are many examples for the library (see GitHub). In addition, another designed library, PKIjs, can be the biggest “example” of using the ASN1js library.

PKIjs


This library was originally conceived as the basis for creating a full-fledged structure of PKI solutions, from the simplest to the most complex. The user should be comfortable working with it, the data should be easily accessible and easily modified. The library has more than 50 different “helpers” for working with all the necessary PKI related structures (such as GeneralName, various types of X.509 certificate extensions, and more). The library has a multilayer structure and can be easily modified and supplemented. In GitHub, you can see current development plans for this library in the “Issues” section.

I will list the set of features of this library:


And now a bit of what is possible to create using PKIjs + ASN1js:


For questions about these libraries, you can contact me directly as the author. Once again I will remind repositories for these libraries: ASN1js and PKIjs . Open to all comments and suggestions.

PS: Adding from 05/07/2014 - forgot to add information on CMS Signed Data + CSM Enveloped Data, corrected.

Source: https://habr.com/ru/post/221857/


All Articles