Skip to content

Signature.toDerBytes

Converts a Signature.Signature to DER-encoded format.

Imports

Named
import { Signature } from 'ox'

Examples

import { Signature } from 'ox'
 
const signature = Signature.from({
  r: 49782753348462494199823712700004552394425719014458918871452329774910450607807n,
  s: 33726695977844476214676913201140481102225469284307016937915595756355928419768n,
})
 
const signature_der = Signature.toDerBytes(signature)
Uint8Array [132, 51, 23, ...]

Definition

function toDerBytes(
  signature: Signature<boolean>,
): Bytes.Bytes

Source: src/Signature.ts

Parameters

signature

  • Type: Signature<boolean>

The signature to convert.

signature.r

  • Type: bigintType

signature.s

  • Type: bigintType

signature.yParity

  • Type: numberType
  • Optional

Return Type

The DER-encoded signature.

Bytes.Bytes