Skip to content

Simple ECDSA features implementation for ICAO eMRTD certificates

Notifications You must be signed in to change notification settings

li0ard/ecdsa_icao

Repository files navigation

ecdsa_icao

This is a pure JS implementation of ECDSA features for eMRTD certificates (ICAO 9303 p.12) with explicit ECC parameters

Docs

Install

bun add github:li0ard/ecdsa_icao

Example

import { curveFromECParams } from "@li0ard/ecdsa_icao"
import { AsnConvert } from "@peculiar/asn1-schema"
import { CertificateChoices } from "@peculiar/asn1-cms"
import fs from "fs"

let certificate = AsnConvert.parse(fs.readFileSync("./cert.der"), CertificateChoices)
let curve = curveFromECParams(certificate.tbsCertificate.subjectPublicKeyInfo.parameters)