Skip to main content

Function: toDerSignature()

toDerSignature(rawSignature): string
Defined in: crypto.ts:584 Converts a raw ECDSA signature to DER-encoded format. This function takes a raw ECDSA signature, which is a concatenation of two 32-byte integers (r and s), and converts it into the DER-encoded format. DER (Distinguished Encoding Rules) is a binary encoding for data structures described by ASN.1.

Parameters

rawSignature

string The raw signature in hexadecimal string format.

Returns

string
  • The DER-encoded signature in hexadecimal string format.

Throws

  • Throws an error if the input signature is invalid or if the encoding process fails.

Example