mppx icon indicating copy to clipboard operation
mppx copied to clipboard

Identity provers require CryptoKey, so remote signers (KMS, HSM, Turnkey) cannot be used

Open figitaki opened this issue 2 weeks ago • 1 comments

Expected Behavior

WebBotAuth.Client.prover and Tap.Client.prover accept a key whose private material stays in a remote signer, such as Turnkey, a cloud KMS, or an HSM.

Current Behavior

Both provers require a CryptoKey. If the private key cannot leave a remote signer, you cannot use the standard provers. You must copy the RFC 9421 signing logic into your application.

Possible Solution

Add a shared SigningKey type that accepts a CryptoKey or a remote signer:

{
  algorithm: 'ed25519' | 'rsa-pss-sha512'
  sign(bytes: Uint8Array): Promise<Uint8Array>
}

The callback receives the complete UTF-8 RFC 9421 signature base and returns the raw signature bytes. Both provers accept this key through the shared HTTP message signer. The CryptoKey path and the signature serialization do not change.

I have an implementation on a fork, with tests and a patch changeset: https://github.com/wevm/mppx/compare/main...tkhq:mppx:carey/remote-identity-signers

I tried to open a PR, but this repository limits PR creation to collaborators. Could a maintainer open the PR from that branch, or tell me which process you prefer?

Minimal Reproducible Example

Try to create a Web Bot Auth or TAP prover with a key that is held in a KMS or HSM. The prover API accepts only a CryptoKey, so there is no way to pass the remote key.

Context

We use this to sign agent requests with keys held in Turnkey. These PRs use the API from the branch above:

  • Turnkey signer adapter: https://github.com/tkhq/sdk/pull/1651
  • TAP example and integration tests: https://github.com/tkhq/sdk/pull/1654 (waiting for this change to be released)

figitaki avatar Nov 13 '26 07:11 figitaki

I'm +1 to this -- do you want to make a pr? we can upstream too

brendanjryan avatar Nov 13 '26 18:11 brendanjryan