mirror of
https://github.com/apple/swift-crypto
synced 2026-11-23 04:34:21 +00:00
Add PEM/DER APIs for Curve25519 ### Checklist - [x] I've run tests to see all new and existing tests pass - [x] I've followed the code style of the rest of the project - [x] I've read the [Contribution Guidelines](CONTRIBUTING.md) - [x] 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