Skip to content

Conversation

ptoffy
Copy link
Contributor

@ptoffy ptoffy commented Oct 15, 2025

Add PEM/DER APIs for Curve25519

Checklist

  • I've run tests to see all new and existing tests pass
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

If you've made changes to gyb files

  • I've run ./scripts/generate_boilerplate_files_with_gyb.sh and included updated generated files in a commit of this pull request

Motivation:

Closes #82
Creating Ed25519/X25519 keys using PEM/DER and also generating their PEM/DER representations can be handy

Modifications:

Added

  • init(pemRepresentation:) and the pemRepresentation computed property
  • init(derRepresentation:) and the derRepresentation computed property

to Curve25519.{Signing,KeyAgreement}.{Private,Public}Key

Result:

Curve25519 can now be created with and can produce PEM/DER representations

@Lukasa Lukasa added the 🆕 semver/minor Adds new public API. label Oct 20, 2025
Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

Can we also add derRepresentation properties to all of these? It's rarely useful to add one without the other.

@ptoffy ptoffy changed the title Add PEM APIs for Curve25519 Add PEM/DER APIs for Curve25519 Oct 20, 2025
@ptoffy ptoffy requested a review from Lukasa October 20, 2025 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PEM/DER Support for Curve25519

2 participants