-
Notifications
You must be signed in to change notification settings - Fork 1
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
[2/3] Implement the exportKey
and importKey
operations with support for HMAC algorithm
#38
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oleiade
force-pushed
the
feature/generateKey-hmac
branch
from
March 31, 2023 08:37
4f79696
to
0360eb2
Compare
oleiade
force-pushed
the
feature/importKey-exportKey-hmac
branch
from
March 31, 2023 08:40
66d876d
to
295b13e
Compare
codebien
reviewed
Mar 31, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
mstoykov
reviewed
Mar 31, 2023
oleiade
force-pushed
the
feature/importKey-exportKey-hmac
branch
from
April 3, 2023 10:05
941b1e8
to
d2fab94
Compare
oleiade
force-pushed
the
feature/importKey-exportKey-hmac
branch
from
April 3, 2023 10:07
d2fab94
to
3649773
Compare
Co-authored-by: Mihail Stoykov <312246+mstoykov@users.noreply.github.com>
oleiade
force-pushed
the
feature/importKey-exportKey-hmac
branch
from
April 3, 2023 10:13
3649773
to
68f9533
Compare
codebien
approved these changes
Apr 4, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
mstoykov
approved these changes
Apr 5, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this?
This Pull Request adds support for the HMAC algorithm to the
subtle.crypto.importKey
andsubtle.crypto.exportKey
operations. It is the second PR of a chain of three PRs converging towards introducing thesign
andverify
APIs to the extension.Our plan moving forward is to go breadth first, and implement as much of the WebCrypto API's surface, and only later to add support for more algorithms. As a result this PR comes in with the intention to support the ability to implement the
sign
andverify
operations to the module.Just like with
encrypt
anddecrypt
, the sign and verify operations test suite rely on the ability to import and export a key of a support algorithm. As a result to support sign and verify with a scope reduced to the HMAC algorithm, we need to implementimportKey
andexportKey
first.Review
Note that like in the
generateKey
PR we introduce a new interface for key import:KeyImporter
. Although we could have extended this principle to key export, we decided to delay that until we support key pairs, as we lack visibility to decide whether or not this will remain a good abstraction in the future.This PR is based on the HMAC support for the
generateKey
PR, and will act as the base for a third PR to come which will introduce thesign
andverify
methods to the extension.