ASN.1 Compilation Services


Convert your ASN.1 specifications into TypeScript, JavaScript, JSON Schema, BSON Schema, and more.

ASN.1 is just as hard for a computer to understand as it is for humans. It could take years and millions of dollars in development for a competent team to implement a fully-featured ASN.1-based protocol. With Wildboar Software's ASN.1 Compilation Services, we can turn your specifications into hundreds of thousands of lines of correct code for pennies on the dollar.

Example


The compiled output below is not exactly what compilation would produce. This is only an example.
ASN.1 Before Compilation
TBSCertificate ::= SEQUENCE {
  version                  [0]  Version DEFAULT v1,
  serialNumber                  CertificateSerialNumber,
  signature                     AlgorithmIdentifier{{SupportedAlgorithms}},
  issuer                        Name,
  validity                      Validity,
  subject                       Name,
  subjectPublicKeyInfo          SubjectPublicKeyInfo,
  issuerUniqueIdentifier   [1] IMPLICIT UniqueIdentifier OPTIONAL,
  ...,
  [[2:  -- if present, version shall be v2 or v3
  subjectUniqueIdentifier  [2] IMPLICIT UniqueIdentifier OPTIONAL]],
  [[3:  -- if present, version shall be v2 or v3
  extensions               [3]  Extensions OPTIONAL ]]
  -- If present, version shall be v3]]
  } (CONSTRAINED BY { -- shall be DER encoded -- } )

Certificate ::= SIGNED{TBSCertificate}
Resulting TypeScript from Compilation
class TBSCertificate {
    constructor (
        readonly version: OPTIONAL<Version>,
        readonly serialNumber: CertificateSerialNumber,
        readonly signature: AlgorithmIdentifier,
        readonly issuer: Name,
        readonly validity: Validity,
        readonly subject: Name,
        readonly subjectPublicKeyInfo: SubjectPublicKeyInfo,
        readonly issuerUniqueIdentifier: OPTIONAL<UniqueIdentifier>,
        readonly _unrecognizedExtensionsList: _Element[] = [],
    ) {}
}

type Certificate = SIGNED<TBSCertificate>;

function _decode_Certificate (
    el: _Element,
) {
    // ...
}

function _encode_Certificate (
    value: Certificate,
    elGetter: $.ASN1Encoder<Certificate>,
) {
    // ...
}

See what can go wrong when you attempt to implement your own ASN.1 here.

See a real library that was generated by the compiler here.

Interested?

Just a five minute conversation could save you millions of dollars down the road. Shoot us an email if we can help!

contact@wildboarsoftware.com
Interested in what we're doing? Let's keep in touch!
Copyright © 2024 by Wildboar Software. All Rights Reserved.