webcrypto.dev-examples

Overview

@peculiar/asn1 is an object-oriented Typescript library that provides support for parsing and serializing ASN.1 data structures.

npm npm (scoped)

Samples

Sample Description
ASN.1 data creation Demonstrates how to create a CertificateTemplate ASN.1 schema, serialize and convert the object to its ASN.1 encoding string representation using the @peculiar/asn1-schema library.
ASN.1 data editing Demonstrates how to to create a CertificateTemplate ASN.1 schema, convert a binary ASN.1 encoding to a CertificateTemplate object, update its properties, and convert it back to binary ASN.1 encoding.
Microsoft Certificate Template extension parsing Demonstrates how to parse and modify a binary ASN.1 encoded CertificateTemplate using schema from @peculiar/asn1-x509-microsoft library, and then convert it to a string and serialize it back to its binary representation.
Certificate parsing Demonstrates how to parse a binary ASN.1 encoded Certificate using schema from @peculiar/asn1-x509 library and display the decoded certificate information.
PKCS10 Certificate Request parsing Demonstrates how to parse a binary ASN.1 encoded CertificationRequest using schema from @peculiar/asn1-csr library and display the decoded certification request information.
CRL parsing Demonstrates how to parse a binary ASN.1 encoded CertificateList using schema from @peculiar/asn1-x509 library and display the decoded CRL information.
OCSP parsing Demonstrates how to parse a binary ASN.1 encoded OCSPResponse using schema from @peculiar/asn1-ocsp library and display the decoded OCSP response information.