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

Custom elliptic curve example #1012

Merged
merged 21 commits into from
Dec 6, 2023
Merged

Custom elliptic curve example #1012

merged 21 commits into from
Dec 6, 2023

Conversation

lestrrat
Copy link
Collaborator

@lestrrat lestrrat commented Nov 8, 2023

No description provided.

@lestrrat
Copy link
Collaborator Author

I just realized that with the current code at 24daab5 we can't convert from jwk.Key to raw key back, especially when we are reusing one of the pre-existing keys. In order to make the round-trip work, we need to be able to inject custom heuristics code in the Raw() method of each object.

@lestrrat lestrrat marked this pull request as ready for review November 19, 2023 09:13
@lestrrat
Copy link
Collaborator Author

lestrrat commented Nov 19, 2023

I think this is ready minus some documentation fixes and possible ironing out of some details (TODO: apply same fixes to OKP, RSA, and symmetric keys)

@lestrrat
Copy link
Collaborator Author

I don't like the naming. Perhaps JR -> Export, RJ -> Import

@lestrrat
Copy link
Collaborator Author

For the record, at this point I think at least 80% of the code works. I'm still missing tests/checks for OKP keys.
I need to revisit and delete dead code, and I need to review the changes and check again if they are user-friendly enough... well, it's not going to be "friendly", because it's complicated, but I hope it's going to be understandable.

@lestrrat
Copy link
Collaborator Author

lestrrat commented Dec 6, 2023

Alright, it's about time. Going to merge to develop/v3

@lestrrat lestrrat merged commit 88a1e76 into develop/v3 Dec 6, 2023
12 checks passed
@lestrrat lestrrat deleted the custom-ec-example branch December 6, 2023 02:00
lestrrat added a commit that referenced this pull request Dec 6, 2023
* Add an example adding new EC algo and key type

* Add failing example

* Kind of fix, but still need to review spec

* Appease linter

* Add more context for debugging

* fix directive

* See if bumping go version to 1.21 only makes a difference

* fix one more

* Rename RJ/JR to Import/Export

* fix usage

* docs

* oops, add missing file

* Streamline exporting from jwk.Key to raw key

Remove Raw() from keys, and implement jwk.Export

* fix typo

* appease linter

* fix type detection for symmetric keys

* rework OKP tests so that crypto/ecdh keys are tested

* fix handling of x25519 keys

* tweak

* tweak docs

* gofmt
lestrrat added a commit that referenced this pull request Jan 11, 2024
* Add an example adding new EC algo and key type

* Add failing example

* Kind of fix, but still need to review spec

* Appease linter

* Add more context for debugging

* fix directive

* See if bumping go version to 1.21 only makes a difference

* fix one more

* Rename RJ/JR to Import/Export

* fix usage

* docs

* oops, add missing file

* Streamline exporting from jwk.Key to raw key

Remove Raw() from keys, and implement jwk.Export

* fix typo

* appease linter

* fix type detection for symmetric keys

* rework OKP tests so that crypto/ecdh keys are tested

* fix handling of x25519 keys

* tweak

* tweak docs

* gofmt
lestrrat added a commit that referenced this pull request Feb 19, 2024
* Add an example adding new EC algo and key type

* Add failing example

* Kind of fix, but still need to review spec

* Appease linter

* Add more context for debugging

* fix directive

* See if bumping go version to 1.21 only makes a difference

* fix one more

* Rename RJ/JR to Import/Export

* fix usage

* docs

* oops, add missing file

* Streamline exporting from jwk.Key to raw key

Remove Raw() from keys, and implement jwk.Export

* fix typo

* appease linter

* fix type detection for symmetric keys

* rework OKP tests so that crypto/ecdh keys are tested

* fix handling of x25519 keys

* tweak

* tweak docs

* gofmt
lestrrat added a commit that referenced this pull request Mar 9, 2024
* Add an example adding new EC algo and key type

* Add failing example

* Kind of fix, but still need to review spec

* Appease linter

* Add more context for debugging

* fix directive

* See if bumping go version to 1.21 only makes a difference

* fix one more

* Rename RJ/JR to Import/Export

* fix usage

* docs

* oops, add missing file

* Streamline exporting from jwk.Key to raw key

Remove Raw() from keys, and implement jwk.Export

* fix typo

* appease linter

* fix type detection for symmetric keys

* rework OKP tests so that crypto/ecdh keys are tested

* fix handling of x25519 keys

* tweak

* tweak docs

* gofmt
lestrrat added a commit that referenced this pull request Sep 24, 2024
* Add an example adding new EC algo and key type

* Add failing example

* Kind of fix, but still need to review spec

* Appease linter

* Add more context for debugging

* fix directive

* See if bumping go version to 1.21 only makes a difference

* fix one more

* Rename RJ/JR to Import/Export

* fix usage

* docs

* oops, add missing file

* Streamline exporting from jwk.Key to raw key

Remove Raw() from keys, and implement jwk.Export

* fix typo

* appease linter

* fix type detection for symmetric keys

* rework OKP tests so that crypto/ecdh keys are tested

* fix handling of x25519 keys

* tweak

* tweak docs

* gofmt
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.

1 participant