Crypto Testing
    Preparing search index...

    Function mockGenerateKeyPair

    • Return a deterministic key pair for the given algorithm.

      For ed25519, x25519, and p256 this returns the well-known test vectors from TEST_KEYS. For any other algorithm a synthetic pair of fixed hex strings is returned.

      Parameters

      • algorithm: string = "ed25519"

      Returns MockKeyPair

      import { mockGenerateKeyPair } from "@sebastienrousseau/crypto-testing";

      const kp = mockGenerateKeyPair("ed25519");
      console.log(kp.publicKey, kp.privateKey);