signGenECDSA

A function to generate a signature for a given message using the ECDSA algorithm.

Import

import { signGenECDSA } from '@silencelaboratories/react-native-duo-sdk';

Usage

signGenECDSA({
  userToken,
  partyKey,
  keyshare,
  hexMessageHash,
})

Parameters

params: { userToken: string, partyKey: ECDSAP1PartyKeys, keyshare: ECDSAP1KeyshareV2, hexMessageHash: string }

  • userToken: string

    • The user JWT token.

  • partyKey: ECDSAP1PartyKeys

    • The party key object.

  • keyshare: ECDSAP1KeyshareV2

    • The keyshare object to use for signature generation.

  • hexMessageHash: string

    • Hash of a message, obtained by hashing it with a hash function and then encoding the result as a hexadecimal string.


Returns

Promise<ECDSAP1Signature>

  • Promise which resolves to the generated signature.

  • The signature is a base64 encoded string.


Error

DuoSDKError | undefined | unknow

  • If signature generation fails, the error object is thrown.


Types

ECDSAP1Signature

type ECDSAP1Signature = {
  signature: string; // base64 encoded signature
  recoveryId: number;
};

Last updated