Skip to content

docs: add PKCS#11 mock fixtures how-to#593

Merged
EffortlessSteven merged 1 commit into
mainfrom
docs/howto-pkcs11-mock
May 12, 2026
Merged

docs: add PKCS#11 mock fixtures how-to#593
EffortlessSteven merged 1 commit into
mainfrom
docs/howto-pkcs11-mock

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Pure docs PR. Task-first how-to for PKCS#11 mock fixtures. Part of the Phase 4 task-first user-paths sweep.

File added

  • docs/how-to/use-pkcs11-mock-fixtures.md — task-first walkthrough of uselesskey-pkcs11-mock: provisioning the mock slot, the MockPkcs11Provider surface (slot info, key handles, sign / verify, certificate DER, sign counter), wiring it behind an HsmSession-style abstraction, the three direct negative paths (unknown handle, wrong slot label, signature tamper), explicit "what this proves / does not prove" claim boundaries, scanner-safety note, and pointers to the crate README and the OIDC / TLS analogue how-tos.

No source changes. No CHANGELOG update.

Validation

  • cargo xtask docs-sync --check — clean
  • cargo xtask typos — clean
  • git diff --check — clean

Task-first user-facing how-to for the `uselesskey-pkcs11-mock` crate.
Walks readers through provisioning a deterministic mock slot, the
provider surface (slot info, key handles, sign/verify, certificate
DER, sign counter), wiring the mock behind an `HsmSession`-style
abstraction, and the three direct negative paths (unknown handle,
wrong slot label, signature tamper).

Mirrors the OIDC / TLS how-to pattern: explicit "what this proves /
does not prove" claim boundaries, scanner-safety note, and pointers
to the analogue how-tos and the crate README. Pure docs PR; no
source changes.
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 6 minutes and 30 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 57f97879-a5d5-452d-ab8f-7e3cf471a4ed

📥 Commits

Reviewing files that changed from the base of the PR and between e1f2f0a and 250364b.

📒 Files selected for processing (1)
  • docs/how-to/use-pkcs11-mock-fixtures.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/howto-pkcs11-mock

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 250364b0d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

| `certificate_der(handle)` | `Option<&[u8]>` | DER-looking bytes, not a parseable X.509 |
| `sign(handle, msg)` | `Option<Vec<u8>>` | `None` for unknown handles |
| `verify(handle, msg, sig)` | `bool` | `false` for unknown handles or wrong signature |
| `next_sign_count()` | `u64` | Monotonic counter for "did the HSM see this call?" assertions |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Don't describe next_sign_count as observing sign calls

This wording is misleading for tests that try to assert whether a signing request reached the mock: MockPkcs11Provider::sign only hashes and returns a signature, while next_sign_count() increments the mutex counter only when that method is called directly, so the counter is not tied to sign/verify activity. A reader following this how-to could write assertions that pass without any HSM-shaped signing call actually occurring; the doc should either explain that callers must advance the counter themselves or avoid presenting it as a "did the HSM see this call?" signal.

Useful? React with 👍 / 👎.

@EffortlessSteven EffortlessSteven merged commit 41ee898 into main May 12, 2026
5 checks passed
@EffortlessSteven EffortlessSteven mentioned this pull request May 12, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant