Interface 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);
interface IAsnSignatureFormatter {
    toAsnSignature(algorithm, signature): null | ArrayBuffer;
    toWebSignature(algorithm, signature): null | ArrayBuffer;
}

Implemented by

Methods

  • 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

  • Converts WebCrypto signature to ASN.1 DER encoded signature value

    Parameters

    • algorithm: Algorithm
    • signature: BufferSource

    Returns null | ArrayBuffer

Generated using TypeDoc