Skip to main content

AsnEcSignatureFormatter

Provides mechanism to convert ASN.1 signature value to WebCrypto and back

To register it's implementation in global use tsyringe container

Example

import { container } from "tsyringe";

container.registerSingleton(diAsnSignatureFormatter, AsnDefaultSignatureFormatter);

Implements

Constructors

new AsnEcSignatureFormatter()

new AsnEcSignatureFormatter(): AsnEcSignatureFormatter

Returns

AsnEcSignatureFormatter

Properties

defaultNamedCurveSize

static defaultNamedCurveSize: number = 32


namedCurveSize

static namedCurveSize: Map<string, number>

Methods

toAsnSignature()

toAsnSignature(algorithm, signature): null | ArrayBuffer

Converts ASN.1 signature to WebCrypto format

Parameters

algorithm: Algorithm

Key and signing algorithm

signature: BufferSource

ASN.1 signature value in DER format

Returns

null | ArrayBuffer

Implementation of

IAsnSignatureFormatter.toAsnSignature


toWebSignature()

toWebSignature(algorithm, signature): null | ArrayBuffer

Converts WebCrypto signature to ASN.1 DER encoded signature value

Parameters

algorithm: Algorithm

signature: BufferSource

Returns

null | ArrayBuffer

Implementation of

IAsnSignatureFormatter.toWebSignature