Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated RSA Public API #981

Merged
merged 4 commits into from
Sep 17, 2022
Merged

Conversation

btoms20
Copy link
Contributor

@btoms20 btoms20 commented Sep 17, 2022

Fixes #980

Checklist:

  • Correct file headers (see CONTRIBUTING.md).
  • Formatted with SwiftFormat.
  • Tests passed

Changes proposed in this pull request:

  • Changed the following initializer and methods on the RSA class from internal to public
init(rawRepresentation: Data) throws

func externalRepresentation() throws -> Data

func publicKeyExternalRepresentation() throws -> Data

@nathanfallet - I went ahead and left the DERCodable protocol internal and just updated the RSA methods to be public in order to only expose the important / necessary methods.

@nathanfallet
Copy link
Collaborator

@btoms20 Why did you chose to make only some methods public?

@btoms20
Copy link
Contributor Author

btoms20 commented Sep 17, 2022

  • The externalRepresentation() method is just a wrapper around the publicKeyDER() & privateKeyDER() methods.
  • Similarly, the init(rawRepresentation:) is a wrapper around init(privateDER:) & init(publicDER:).
  • At this point the public facing api is similar to that of Apple's Security framework.

@nathanfallet nathanfallet merged commit caf228a into krzyzanowskim:main Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants