Skip to content

Add round trip test for WolfSSLCertificate.setAuthorityKeyId()#362

Open
cconlon wants to merge 1 commit intowolfSSL:masterfrom
cconlon:akidTest
Open

Add round trip test for WolfSSLCertificate.setAuthorityKeyId()#362
cconlon wants to merge 1 commit intowolfSSL:masterfrom
cconlon:akidTest

Conversation

@cconlon
Copy link
Copy Markdown
Member

@cconlon cconlon commented Apr 30, 2026

Improve the Javadoc on setAuthorityKeyId(byte[]) and setAuthorityKeyIdEx to specify that the byte argument is the raw key identifier value (not a pre-encoded AuthorityKeyIdentifier SEQUENCE), and call out the dependency on the wolfSSL AKID encoder fix in wolfSSL PR #10370.

Adds new test testWolfSSLCertificateAuthorityKeyIdRoundtrip(), which signs a cert with each setter, re-parses it via java.security.cert.CertificateFactory, and makes sure the AKID extension matches the RFC 5280 4.2.1.1 SEQUENCE { [0] keyIdentifier }. The test runs a check up front to auto-detect native AKID encoder state, so we just run the test if native wolfSSL has been fixed with the fix in wolfSSL PR #10370.

@cconlon cconlon self-assigned this Apr 30, 2026
Copilot AI review requested due to automatic review settings April 30, 2026 22:07
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a regression/round-trip test to ensure WolfSSLCertificate’s Authority Key Identifier (AKID) setters produce RFC 5280-compliant encodings, and clarifies the public Javadoc around the expected AKID input format.

Changes:

  • Add testWolfSSLCertificateAuthorityKeyIdRoundtrip() plus helpers to sign, re-parse via JDK CertificateFactory, and assert AKID extension structure.
  • Add a runtime “behavioral probe” to skip the new test when running against native wolfSSL builds without the AKID encoder fix.
  • Update Javadoc for setAuthorityKeyId(byte[]) and setAuthorityKeyIdEx(...) to clarify the semantics of the input/derived key identifier.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/test/com/wolfssl/test/WolfSSLCertificateTest.java Adds AKID round-trip test and DER parsing helpers to validate RFC 5280 AKID encoding.
src/java/com/wolfssl/WolfSSLCertificate.java Clarifies Javadoc for AKID-related setters (raw key identifier vs pre-encoded ASN.1).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/test/com/wolfssl/test/WolfSSLCertificateTest.java Outdated
Comment thread src/java/com/wolfssl/WolfSSLCertificate.java Outdated
@cconlon
Copy link
Copy Markdown
Member Author

cconlon commented Apr 30, 2026

Waiting to move through review process until wolfSSL/wolfssl#10370 is merged.

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.

2 participants