Skip to content

Add AccountKey tests#71

Draft
toddr-bot wants to merge 1 commit intomainfrom
koan.toddr.bot/test-account-key
Draft

Add AccountKey tests#71
toddr-bot wants to merge 1 commit intomainfrom
koan.toddr.bot/test-account-key

Conversation

@toddr-bot
Copy link
Copy Markdown
Contributor

@toddr-bot toddr-bot commented Apr 7, 2026

What

Comprehensive test coverage for Net::ACME2::AccountKey, the crypto backend abstraction layer that had zero dedicated tests.

Why

AccountKey is on the critical path for every ACME operation — it handles key parsing, backend selection (CryptX vs Crypt::Perl), signing, and JWK export. All existing tests only exercised it indirectly through JWTMaker or the mock ACME server.

How

39 tests covering:

  • Constructor with RSA and ECDSA keys (both PEM and DER formats)
  • Key type detection via PEM header guessing and Crypt::Perl fallback
  • Public JWK export (correct structure, no private key leakage)
  • JWK thumbprint determinism and uniqueness
  • JWA algorithm selection for P-256 and P-384 curves
  • RS256 signing (determinism) and JWA signing (non-determinism)
  • Signature verification round-trip via Crypt::Perl
  • $@ preservation across constructor (CryptX eval guards)
  • PEM vs DER equivalence for JWK and thumbprint output

Testing

make test — all 346 tests pass (21 files including this new one).

🤖 Generated with Claude Code


Quality Report

Changes: 2 files changed, 279 insertions(+)

Code scan: clean

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

39 tests covering the crypto backend abstraction layer:
constructor (PEM and DER), key type detection, JWK export,
thumbprint generation, signing (RSA and ECDSA), signature
verification round-trip, PEM/DER equivalence, and $@ preservation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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