Giter VIP home page Giter VIP logo

asn1-schema's Introduction

asn1-schema

License Test Coverage Status

asn1-schema is a collection of TypeScript schemas that make working with common ASN.1 objects easy.

List of schemas

Usage

import { AsnParser } from "@peculiar/asn1-schema";
import { Certificate } from "@peculiar/asn1-x509";

const pem = "MIIFjjCCBHagAwIBAgIMVcQBzZcO9v+nopB ... HCiLvXBWEiC6qLVM2dKZ/Ab8Xv+/3Q==";
const cert = AsnParser.parse(Buffer.from(pem, "base64"), Certificate);

console.log(cert);

Output

Certificate {
  tbsCertificate: TBSCertificate {
    version: 2,
    serialNumber: ArrayBuffer {
      [Uint8Contents]: <55 c4 01 cd 97 0e f6 ff a7 a2 90 7e>,
      byteLength: 12
    },
    signature: AlgorithmIdentifier {
      algorithm: '1.2.840.113549.1.1.11',
      parameters: null
    },
    issuer: Name { rdnSequence: [RDNSequence] },
    validity: Validity { notBefore: [Time], notAfter: [Time] },
    subject: Name { rdnSequence: [RDNSequence] },
    subjectPublicKeyInfo: SubjectPublicKeyInfo {
      algorithm: [AlgorithmIdentifier],
      subjectPublicKey: [ArrayBuffer]
    },
    extensions: [
      [Extension], [Extension],
      [Extension], [Extension],
      [Extension], [Extension],
      [Extension], [Extension],
      [Extension], [Extension]
    ]
  },
  signatureAlgorithm: AlgorithmIdentifier {
    algorithm: '1.2.840.113549.1.1.11',
    parameters: null
  },
  signatureValue: ArrayBuffer {
    [Uint8Contents]: <ab 39 6f 0d a3 67 ac bf 9d 9d 20 75 da 14 ba fd 91 c5 f5 34 db d4 17 a0 88 ec 6f d5 bd 1d d3 31 df b9 f8 85 5a b0 42 02 f6 74 3f d1 35 fa 38 cb 7e 22 09 73 6d f1 b1 b6 95 c9 49 95 a1 b1 0f 80 21 d5 e6 52 02 ee ef bd 41 31 85 d1 1e 21 58 58 74 ab a6 67 ca d6 28 39 ad ca 3e 43 be ad 0e 71 85 63 1e 67 ... 156 more bytes>,
    byteLength: 256
  }
}

Development

Create schema

yarn run create <name>

asn1-schema's People

Contributors

microshine avatar dhensby avatar donskov avatar jstewmon avatar rmhrisk avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.