Skip to main content

IAsnSignatureFormatter

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);

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


toWebSignature()

toWebSignature(algorithm, signature): null | ArrayBuffer

Converts WebCrypto signature to ASN.1 DER encoded signature value

Parameters

algorithm: Algorithm

signature: BufferSource

Returns

null | ArrayBuffer