Skip to content

Correct WebCrypto result types and verify key workflows #390

Open

Description

@jderochervlk

Part of #382 — v1.0.0 alpha readiness.

Problem

Several SubtleCrypto operations are declared as returning JSON.t, although their native results are binary values or opaque keys:

A native Node WebCrypto probe confirmed the HMAC generate/sign/verify, digest, and raw-export result shapes. Current signatures prevent safe composition of key-producing and key-consuming functions without escaping the types.

Acceptance criteria

  • Correct fixed native result types, including verify to boolean.
  • Model algorithm-dependent key generation and format-dependent key export with explicit overloads or a decoded abstract type, following existing binding conventions.
  • Re-export the public support types required to compose the supported workflows without unsafe casts or internal-module imports.
  • Compile and run generate -> sign -> verify, digest -> byte view, and representative raw/JWK export workflows.
  • Cover a key-pair generation result as well as a single symmetric key.
  • Update affected docs and compile fixtures, with negative coverage for the former incorrect result assumptions.

Do not broaden this issue into an unrelated cryptography abstraction or change native promise rejection semantics.

Coordination

Use the regression infrastructure in #383. Source fixes can be developed in parallel, but this issue should close with executed regression coverage, not only a successful compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions