-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add examples for deriveBits #39
Conversation
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.
This looks good to me, from a comprehension/editorial perspective, so I'm approving.
The only comment that came to mind was maybe you should link the mention of "deriveBits()" to the appropriate reference page on MDN, when it is available, and do the same for the other example pages?
Once @april has given this a review and approved, I think we can merge it. |
It's a good suggestion and I don't know why I didn't do this (and BTW deriveBits is available now, I wrote the page yesterday: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/deriveBits). But it would apply to all the examples (e.g. https://github.com/mdn/dom-examples/blob/master/web-crypto/derive-key/index.html#L14), so it would be much easier to do this as a single follow-up PR, rather than amend every open PR with this change, so can we do that? |
Yup, absolutely. |
Overall it looks fine to me, other than to say that if we're deriving a 256-bit key in |
Thanks again for the reviews!
Again, I don't know why I did this :). I've updated the PR.
I've filed #40 so we don't forget. |
Cool, all looks good then. Merging. |
@@ -8,7 +8,7 @@ | |||
public: publicKey |
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.
mdn:master
@@ -48,4 +48,5 @@ | |||
deriveBitsButton.addEventListener("click", () => { | |||
getDerivedBits(); | |||
}); | |||
|
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.
51
Examples for the
deriveBits()
API. This is likederiveKey()
, except thatderiveKey()
also imports the bits as aCryptoKey
, enabling you to actually use the derived key to do things like encryption.So these examples are based on the examples for
deriveKey()
, except they're simpler because you can't actually use the derived bits to encrypt.I think this is the last example we need :).