Skip to main content

AsnDefaultSignatureFormatter

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 AsnDefaultSignatureFormatter()

new AsnDefaultSignatureFormatter(): AsnDefaultSignatureFormatter

Returns

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

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