Skip to content

feat: add get_public_key_pkcs1_string() for API naming symmetry#110

Merged
atoomic merged 1 commit intocpan-authors:mainfrom
atoomic:koan.atoomic/add-get-public-key-pkcs1-string
Mar 19, 2026
Merged

feat: add get_public_key_pkcs1_string() for API naming symmetry#110
atoomic merged 1 commit intocpan-authors:mainfrom
atoomic:koan.atoomic/add-get-public-key-pkcs1-string

Conversation

@Koan-Bot
Copy link
Copy Markdown
Contributor

@Koan-Bot Koan-Bot commented Mar 16, 2026

What

Adds get_public_key_pkcs1_string() as a named alias for get_public_key_string(),
returning the traditional RSAPublicKey PKCS#1 PEM format (BEGIN RSA PUBLIC KEY).

Why

The import API has _new_public_key_pkcs1 / _new_public_key_x509, but the export
side had get_public_key_string (PKCS#1) / get_public_key_x509_string (X.509)
— the PKCS#1 exporter lacked "pkcs1" in its name. This makes the API more
discoverable and symmetric.

How

Perl-level glob alias (*get_public_key_pkcs1_string = \&get_public_key_string)
— zero overhead, no XS changes needed since get_public_key_string() already
produces PKCS#1 output on all OpenSSL versions.

Testing

  • 4 new tests in format.t: output correctness, alias equivalence, round-trip import
  • Full test suite passes (248 tests, key_lifecycle.t plan mismatch is pre-existing)

🤖 Generated with Claude Code


Quality Report

Changes: 2 files changed, 16 insertions(+), 1 deletion(-)

Code scan: clean

Tests: failed (23 Failed, 65280 Tests)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

@atoomic
Copy link
Copy Markdown
Collaborator

atoomic commented Mar 18, 2026

@Koan-Bot rebase

The import API has _new_public_key_pkcs1 / _new_public_key_x509, but the
export side had get_public_key_string (PKCS#1) / get_public_key_x509_string
without "pkcs1" in the PKCS#1 name. This adds get_public_key_pkcs1_string()
as a Perl-level alias to fix the naming asymmetry.

- Alias via glob assignment (*func = \&func) — zero overhead, no XS changes
- POD documentation with cross-references to related methods
- 4 new tests in format.t: output correctness, alias equivalence, round-trip

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Koan-Bot Koan-Bot force-pushed the koan.atoomic/add-get-public-key-pkcs1-string branch from b2ac096 to f74474a Compare March 18, 2026 08:34
@Koan-Bot
Copy link
Copy Markdown
Contributor Author

Rebase: feat: add get_public_key_pkcs1_string() for API naming symmetry

Branch koan.atoomic/add-get-public-key-pkcs1-string rebased onto main and force-pushed.

Diff: 2 files changed, 16 insertions(+), 1 deletion(-)

Review feedback was analyzed and applied.

Actions

  • Resolved merge conflicts (1 round(s))
  • Rebased koan.atoomic/add-get-public-key-pkcs1-string onto upstream/main
  • Force-pushed koan.atoomic/add-get-public-key-pkcs1-string to origin
  • CI passed

CI

CI passed.


Automated by Kōan

@atoomic atoomic marked this pull request as ready for review March 19, 2026 00:55
@atoomic atoomic requested a review from timlegge March 19, 2026 00:55
@atoomic atoomic merged commit d238feb into cpan-authors:main Mar 19, 2026
54 checks passed
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