UNPKG

js-crypto-ec

Version:

Universal Module for Elliptic Curve Cryptography (ECDSA and ECDH) in JavaScript

19 lines (18 loc) 748 B
/** * asn1enc.js */ import { CurveTypes } from './typedef'; /** * Decode ASN.1 encoded signature byte array. * @param {Uint8Array} asn1sig - Byte array of ASN.1 encoded signature. * @param {String} namedCurve - Name of curve like 'P-256'. * @return {Uint8Array} - Decoded raw signature. */ export declare const decodeAsn1Signature: (asn1sig: Uint8Array, namedCurve: CurveTypes) => Uint8Array; /** * Encode raw signature and obtain ASN.1-encoded signature. * @param {Uint8Array} signature - Byte array of raw signature. * @param {String} namedCurve - Name of curve like 'P-256'. * @return {Uint8Array} - Encoded ASN.1 signature. */ export declare const encodeAsn1Signature: (signature: Uint8Array, namedCurve: CurveTypes) => Uint8Array;