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

HMS-2693 feat: Implement JWK creation and load #14

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

tiran
Copy link
Collaborator

@tiran tiran commented Oct 4, 2023

Implement functions to create a new JWK with expected properties and load a serialized JWK.

GenericePrivateJWK() creates a private JWK with EC / P256, kid, and expiration time stamp.

GetPublicJWK() is a helper to create a public JWK from a private JWK.

ParseJWK() deserializes a JWK string that has been previously serialized with json.Marshal. The function validates various properties including expiration.

@tiran tiran marked this pull request as draft October 5, 2023 06:15
@tiran tiran marked this pull request as ready for review October 5, 2023 06:21
@tiran
Copy link
Collaborator Author

tiran commented Oct 5, 2023

I have modified GenericePrivateJWK() to take an expiration time instead of a validity time duration. It makes it easier to test the code and later to store the expiration time in the database.

@frasertweedale frasertweedale self-requested a review October 5, 2023 13:00
Copy link
Contributor

@frasertweedale frasertweedale left a comment

Choose a reason for hiding this comment

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

One nit. Apart from that, I'm happy with the PR and feel free to merge.

Implement functions to create a new JWK with expected properties and
load a serialized JWK.

`GenericePrivateJWK()` creates a private JWK with EC / P256, kid, and
expiration time stamp.

`GetPublicJWK()` is a helper to create a public JWK from a private JWK.

`ParseJWK()` deserializes a JWK string that has been previously
serialized with `json.Marshal`. The function validates various
properties including expiration.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
@frasertweedale
Copy link
Contributor

Thanks! Merging.

@frasertweedale frasertweedale merged commit ad34162 into podengo-project:main Oct 6, 2023
1 check passed
@tiran tiran deleted the hms-2693-jwk branch October 6, 2023 05:46
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.

2 participants