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

Add JWK support to AES #10

Merged
merged 2 commits into from Aug 12, 2019

Conversation

@tniessen
Copy link
Member

commented Aug 10, 2019

This adds support for the jwk key format when importing and exporting AES keys. This is specified in different places in the WebCrypto spec (once per AES algorithm), the first relevant section is 25.7.

@tniessen tniessen added the jwk label Aug 10, 2019

@tniessen tniessen referenced this pull request Aug 11, 2019

Merged

Add HMAC #12

@tniessen tniessen requested a review from sam-github Aug 12, 2019

Show resolved Hide resolved lib/algorithms/aes.js Outdated

@tniessen tniessen force-pushed the tniessen:add-aes-jwk branch from 3adbdd4 to b4ea2d7 Aug 12, 2019

@tniessen tniessen force-pushed the tniessen:add-aes-jwk branch from b4ea2d7 to bace017 Aug 12, 2019

}
};

module.exports.decodeBase64Url = (enc) => {

This comment has been minimized.

Copy link
@sam-github

sam-github Aug 12, 2019

Member

this is an alternative b64 encoding? maybe you can link to the spec for it?

This comment has been minimized.

Copy link
@panva

panva Aug 12, 2019

Defined in https://tools.ietf.org/html/rfc4648#section-5

And throughout JOSE rfc family applied with no padding.

This comment has been minimized.

Copy link
@tniessen

tniessen Aug 12, 2019

Author Member

Yeah, I never came across it before either. Super weird stuff.

This comment has been minimized.

Copy link
@tniessen

tniessen Aug 12, 2019

Author Member

I also considered using replace, but I assumed that using three regular expressions just to substitute single characters cannot possibly be efficient. On the other hand, right now I am splitting the string into a character array, mapping it onto a different array and creating a new string out of it, so my approach also seems terribly inefficient. (Great candidate for premature optimization!)

@tniessen tniessen force-pushed the tniessen:add-aes-jwk branch from bace017 to bfd2be4 Aug 12, 2019

@tniessen tniessen merged commit 99c9f8a into nodejs:master Aug 12, 2019

1 check passed

Travis CI - Pull Request Build Passed
Details

@tniessen tniessen deleted the tniessen:add-aes-jwk branch Aug 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.