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

Deprecation Warnings and Making export() Method of PublicKey Public #60

Open
pheckenlWork opened this issue Jul 27, 2021 · 6 comments
Open

Comments

@pheckenlWork
Copy link
Contributor

First, THANK YOU for developing this library. We used it to develop a
VPN solution for our company.

While working with EllipticCurveKeyPair.swift, We noticed that there
are several places where the code now generates deprecation warnings.
Also, the export() method of the PublicKey class is marked private.
For our application, I needed to export the public key to generate a
CSR. I can't think of a reason why this method should be private.

I would be happy to provide a PR for these issues. I thought it would
be more friendly to start with an issue (instead of doing a drive by
PR).

@hfossli-agens
Copy link
Contributor

I guess main branch and develop is a bit stale. I have been working on a new api https://github.com/agens-no/EllipticCurveKeyPair/blob/renewed-api/Sources/EllipticCurveKeyPair.swift, but haven't finished it entirely.

A PR for your pressing needs would be perfect start.

@pheckenlWork
Copy link
Contributor Author

I do not appear to have permission to push my local branch to the repo.

@hfossli-agens
Copy link
Contributor

You fork and push to your fork then open a pull request :)

@pheckenlWork
Copy link
Contributor Author

Thanks. For better or worse, most of my git experience with with corporate repos. PR is open.

@hfossli-agens
Copy link
Contributor

The export func is intentionally private. Use .data() and then .DER or .PEM to export the key in your desired format. See example here

publicKeyTextView.text = key.PEM

Can you explain the other proposed changes? :)

@pheckenlWork
Copy link
Contributor Author

I figured that the choice to make the export() method private was intentional. :-) In my use case, I'm trying to make a CSR, so exporting the bits directly was the quickest way to get where I needed to go.

I developed my solution on the latest MacOS with the latest Xcode. Xcode generated several deprecation warnings, and these code changes are my attempt to fix them.

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

No branches or pull requests

2 participants