Function getASN1

  • generate ASN.1 DER/BER encoded hexadecimal string from JSON data

    Parameters

    • p: ASN1Data

      JSON object representing ASN.1 structure

    Returns string

    hexadecimal string of ASN.1 DER/BER encoded hexadecimal string

    Example

    getASN1({ t: "int", v: "12ab" }) -> "020212ab"
    getASN1({ t: "seq", v: [
    { t: "int", v: "01" },
    { t: "int", v: "02" }
    ]}) -> "3006020101020102"