@websign/sdk - v0.1.0
    Preparing search index...

    Module @websign/sdk/testing

    @websign/sdk/testing — a FAKE WebeSign extension and app for your unit and end-to-end tests, and for demos without the real thing installed.

    Install it on window and the real @websign/sdk talks to it unchanged: status(), certificates() and sign() work, prepare runs, and the signatures are real ECDSA P-256 / RSA-2048 made with public test keys, so your code can verify them. Scripted outcomes cover every state a visitor's computer can be in.

    NEVER ship it: anyone can sign with the test keys. It refuses to install outside localhost-like origins unless told otherwise, and warns on the console every time it installs.

    import { installFakeWebSign } from "@websign/sdk/testing";
    import { sign } from "@websign/sdk";

    const fake = await installFakeWebSign();
    const result = await sign({ hash: "SHA-256", prepare: (_, { hash }) => crypto.subtle.digest(hash, data) });
    expect(await fake.verify(result, data)).toBe(true);
    fake.uninstall();

    @packageDocumentation
    FakeCertificateOptions
    FakeOptions
    FakeWebSign
    FakeRequest
    FakeScenario
    CertificatePick
    installFakeWebSign