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 to PEM converters #4876

Merged
merged 21 commits into from
Jan 24, 2023
Merged

Add JWK to PEM converters #4876

merged 21 commits into from
Jan 24, 2023

Conversation

jumaffre
Copy link
Contributor

Resolves #4865

This PR adds support for JWK to PEM conversion for all supported key types (EC, RSA, EdDSA) for both the C++ and JS/TS APIs.

@jumaffre jumaffre requested a review from a team January 23, 2023 11:45
@jumaffre jumaffre added auto-backport Automatically backport this PR to LTS branch 3.x-todo PRs which should be backported to 3.x labels Jan 23, 2023
@ghost
Copy link

ghost commented Jan 23, 2023

jwk_to_pem@61810 aka 20230123.49 vs main ewma over 20 builds from 61110 to 61795

Click to see table

main

build_id build_number Commit latency factor tpcc_virtual_cft^ ls_virtual_cft^ pi_ls_virtual_cft^ ls_jwt_virtual_cft^ pi_ls_jwt_virtual_cft^ ls_js_virtual_cft^ ls_full_js_virtual_cft^ ls_js_jwt_virtual_cft^ tpcc_sgx_cft^ tpcc_sgx_cft_mem hist_sgx_cft^ ls_sgx_cft^ ls_sgx_cft_mem pi_ls_sgx_cft^ pi_ls_sgx_cft_mem ls_jwt_sgx_cft^ ls_jwt_sgx_cft_mem pi_ls_jwt_sgx_cft^ pi_ls_jwt_sgx_cft_mem ls_js_sgx_cft^ ls_js_sgx_cft_mem ls_full_js_sgx_cft^ ls_full_js_sgx_cft_mem ls_js_jwt_sgx_cft^ ls_js_jwt_sgx_cft_mem RB put (/s)^ CHAMP put (/s)^ RB get (/s)^ CHAMP get (/s)^
61110 20230117.56 0.796177 17253.4 43663.6 44315.7 12875.9 12793.8 4457.44 3562.38 3275.86 6342.36 8.1662e+07 28330.4 14962.9 1.53396e+07 15410.9 8.2617e+06 5533.35 1.45532e+07 5591.2 4.59168e+06 1547.1 7.73741e+06 1278.94 7.47526e+06 1281.06 6.95098e+06 837138 1.18075e+06 8.15082e+06 3.12129e+07
61131 20230117.61 0.773678 17305.4 40260.5 46181.7 12728.8 13413.7 4433.02 3531.15 3288.79 6340.25 8.13999e+07 27085.5 15197.8 1.53396e+07 15502.3 8.2617e+06 5552.3 1.45532e+07 5592.6 4.59168e+06 1546.71 7.73741e+06 1281.27 7.47526e+06 1287.61 6.95098e+06 831503 1.17746e+06 8.1732e+06 3.08308e+07
61169 20230118.4 0.798605 17151.2 41846.8 44474.9 12812.9 13611.4 4494.54 3579.11 3278.32 6326.91 8.19242e+07 23021.2 15260.2 1.53396e+07 15478.3 8.2617e+06 5524.91 1.4291e+07 5602 4.59168e+06 1550.78 7.73741e+06 1275.16 7.21312e+06 1287.63 6.95098e+06 829989 1.17598e+06 8.15244e+06 3.07743e+07
61170 20230118.5 0.788081 17114.7 42059.3 44119.5 12767.5 12481.9 4619.63 3651.25 3359.44 5625.96 8.27106e+07 22638.1 14819.1 1.58639e+07 15317 7.99955e+06 5485.72 1.45532e+07 5492.8 4.59168e+06 1529.48 7.73741e+06 1260.01 7.73741e+06 1266.11 6.95098e+06 834046 1.1723e+06 8.15261e+06 3.07194e+07
61219 20230118.17 0.782752 17289.5 41967.2 43879.9 12649.8 13208.8 4421.76 3556.53 3270.93 6246.76 8.24484e+07 24906 14969.5 1.50774e+07 15395 8.2617e+06 5498.44 1.45532e+07 5521 4.59168e+06 1551.77 7.73741e+06 1268.59 7.73741e+06 1270.18 6.95098e+06 840049 1.17581e+06 8.15277e+06 3.04173e+07
61286 20230118.38 0.781962 17207.1 40313.3 46609.2 12651.7 12403.1 4421.85 3601.57 3328.69 5559.74 8.29727e+07 27493 14902.2 1.53396e+07 15502.1 8.2617e+06 5513.89 1.4291e+07 5629.7 4.59168e+06 1552.42 7.73741e+06 1267.31 7.73741e+06 1257.69 6.95098e+06 835206 1.17466e+06 8.12876e+06 3.07272e+07
61356 20230118.54 0.819813 16930.1 41973.3 46133.5 11272.1 12845.9 4511.89 3563.6 3404.02 6321.88 8.19242e+07 23469.3 15198 1.53396e+07 15459.6 8.2617e+06 5499.07 1.48153e+07 5557.8 4.59168e+06 1550.82 7.73741e+06 1272.66 7.73741e+06 1286.36 6.95098e+06 834265 1.17596e+06 8.15037e+06 3.11976e+07
61393 20230119.3 0.798112 17159.6 41725.5 46586.4 12649.1 13677.1 4443.7 3493.65 3326.59 6320.85 8.21863e+07 21396.1 15321 1.53396e+07 15514.6 8.2617e+06 5546.04 1.4291e+07 5607.1 4.59168e+06 1562.23 7.73741e+06 1286.09 7.73741e+06 1288.77 6.95098e+06 833171 1.18046e+06 8.13518e+06 3.07956e+07
61446 20230119.18 0.814237 17090.7 43580.9 45555.4 12847.8 12902.4 4458.21 3549.8 3319.75 5643.46 8.21863e+07 27906.5 14902.7 1.53396e+07 15402.1 8.2617e+06 5543.37 1.45532e+07 5569.9 4.59168e+06 1538.04 7.73741e+06 1270.13 7.21312e+06 1279.56 6.95098e+06 829624 1.16898e+06 8.14136e+06 3.07083e+07
61496 20230120.3 0.793002 17022.4 43791.4 43816.6 12758.9 13204.8 4323.48 3651.9 3347.32 6339.53 8.21863e+07 28949.9 15247.1 1.50774e+07 15494 8.2617e+06 5523.29 1.45532e+07 5596.6 4.59168e+06 1551.62 7.73741e+06 1283.53 7.73741e+06 1289.97 6.95098e+06 838961 1.17538e+06 8.15504e+06 3.1181e+07
61592 20230120.25 0.800091 17073.5 43699.4 44368.1 12822.5 12619.8 4684.64 3545.9 3266.84 5567.24 8.29727e+07 24192.6 14951.6 1.58639e+07 15285.7 8.2617e+06 5516.61 1.48153e+07 5518.9 4.59168e+06 1526.91 7.73741e+06 1259.69 7.21312e+06 1253.88 6.95098e+06 838525 1.17566e+06 8.15121e+06 3.08063e+07
61627 20230120.38 0.764873 17152.9 43887.6 46790.4 12909.9 13687.6 4653.16 3573.07 3457.77 5633.08 8.27106e+07 27770.3 14915.7 1.58639e+07 15269 8.2617e+06 5486.59 1.50774e+07 5524 4.59168e+06 1529.06 7.73741e+06 1261.4 7.21312e+06 1248.92 6.95098e+06 837141 1.17663e+06 8.15569e+06 3.09876e+07
61645 20230121.6 0.797522 17255.4 41902 44130.8 12831.9 12546.9 4484.13 3688.71 3316.24 6306.85 8.19242e+07 23919.1 15306 1.50774e+07 15515.1 8.2617e+06 5497.87 1.4291e+07 5593.5 4.59168e+06 1562.03 7.73741e+06 1285.24 7.21312e+06 1290.01 6.95098e+06 835517 1.17566e+06 8.15442e+06 3.05722e+07
61657 20230123.3 0.788048 17197.4 43844.6 44541.5 12845.3 13387.6 4401.52 3525.93 3461.93 6359.09 8.21863e+07 23272.7 15065 1.53396e+07 15532.7 8.2617e+06 5535.35 1.45532e+07 5592.9 4.59168e+06 1548.62 7.73741e+06 1271.89 7.21312e+06 1289.87 6.95098e+06 848120 1.17607e+06 8.15527e+06 3.13653e+07
61664 20230123.6 0.807185 17080.1 40207.5 45572.4 12789.8 12723.8 4604.38 3661.03 3304.92 6262.04 8.27106e+07 32211.5 14987.2 1.53396e+07 15432.7 8.2617e+06 5532.1 1.45532e+07 5595.8 4.59168e+06 1554.77 7.73741e+06 1283.67 7.21312e+06 1276.89 6.95098e+06 833370 1.18275e+06 8.17467e+06 3.08127e+07
61690 20230123.15 0.786332 17159.6 43506.4 46575.8 11461.3 12845.7 4632.27 3635.67 3357.9 6313.15 8.21863e+07 23921 15174.3 1.53396e+07 15492.8 8.2617e+06 5518.6 1.48153e+07 5627.1 4.59168e+06 1549.54 7.73741e+06 1283.43 7.21312e+06 1279.77 6.95098e+06 835449 1.17757e+06 8.15563e+06 3.11412e+07
61702 20230123.18 0.791619 17018.7 43597.5 44193.4 12680.3 12471.2 4586.73 3550.96 3338.8 5605.13 8.24484e+07 27939.7 14922 1.56017e+07 15380.5 8.2617e+06 5564.22 1.45532e+07 5533.3 4.59168e+06 1546.49 7.73741e+06 1271.37 7.21312e+06 1257.87 6.95098e+06 840952 1.17598e+06 8.15589e+06 3.07965e+07
61730 20230123.27 0.815348 16818.3 43683.2 44670.6 12599.9 11977.8 4660.1 3524.07 3317.17 6345.18 8.27106e+07 22944.1 15283.5 1.53396e+07 15524.9 8.2617e+06 5535.64 1.45532e+07 5593.6 4.59168e+06 1546.72 7.73741e+06 1279.56 7.47526e+06 1283.21 6.95098e+06 835250 1.1752e+06 8.15553e+06 3.07568e+07
61784 20230123.41 0.784155 17158.2 42067.1 44310.1 11394.5 12717.5 4648.61 3554.07 3419.04 5616.99 8.27106e+07 22922.2 14948.1 1.58639e+07 15221.3 8.2617e+06 5462.05 1.45532e+07 5502.6 4.59168e+06 1532.79 7.73741e+06 1263.41 7.47526e+06 1270.27 6.95098e+06 838066 1.18049e+06 8.12324e+06 3.08109e+07
61795 20230123.44 0.799575 17102.9 43729.7 44155.8 12795.2 13094.7 4568.6 3529.84 3324.6 6266.28 8.24484e+07 26293.8 15147.6 1.53396e+07 15371.1 8.2617e+06 5592.07 1.45532e+07 5590.2 4.59168e+06 1549.62 7.73741e+06 1278.01 7.21312e+06 1262.67 6.95098e+06 827262 1.17738e+06 8.17398e+06 3.09862e+07

jwk_to_pem

build_id build_number Commit latency factor tpcc_virtual_cft^ ls_virtual_cft^ pi_ls_virtual_cft^ tpcc_sgx_cft^ tpcc_sgx_cft_mem ls_jwt_virtual_cft^ pi_ls_jwt_virtual_cft^ ls_js_virtual_cft^ ls_sgx_cft^ ls_sgx_cft_mem ls_full_js_virtual_cft^ pi_ls_sgx_cft^ pi_ls_sgx_cft_mem ls_js_jwt_virtual_cft^ ls_jwt_sgx_cft^ ls_jwt_sgx_cft_mem pi_ls_jwt_sgx_cft^ pi_ls_jwt_sgx_cft_mem ls_js_sgx_cft^ ls_js_sgx_cft_mem hist_sgx_cft^ ls_full_js_sgx_cft^ ls_full_js_sgx_cft_mem ls_js_jwt_sgx_cft^ ls_js_jwt_sgx_cft_mem RB put (/s)^ CHAMP put (/s)^ RB get (/s)^ CHAMP get (/s)^
61727 20230123.26 0.812882 17030.1 43737.9 45151.8 5609.44 8.27106e+07 12630.6 12498.7 4413.33 14833.2 1.56017e+07 3591.21 15459.8 8.2617e+06 3345.14 5503.15 1.45532e+07 5510.9 4.59168e+06 1529.33 7.73741e+06 21707.9 1258.27 7.21312e+06 1247.75 6.95098e+06 831426 1.1777e+06 8.17196e+06 3.07692e+07
61775 20230123.38 0.831309 17147.5 43875.6 45153 6298.96 8.19242e+07 12875.3 12756.9 4446.89 15253.9 1.53396e+07 3571.78 15515 8.2617e+06 3322.92 5580.04 1.45532e+07 5631.5 4.59168e+06 1544 7.73741e+06 24392 1270.36 7.73741e+06 1263.3 6.95098e+06 818668 1.17624e+06 8.15348e+06 3.08026e+07
61790 20230123.42 0.811665 17127.2 43742.4 46848.9 6316.69 8.21863e+07 12451.6 13572.2 4377.82 15007.5 1.53396e+07 3446.83 15527.6 8.2617e+06 3317.7 5520.71 1.4291e+07 5629.3 4.59168e+06 1548.07 7.73741e+06 21660 1255.05 7.73741e+06 1261.5 6.95098e+06 833284 1.18512e+06 8.15449e+06 3.04011e+07
61800 20230123.45 0.786781 17156.8 43737.9 43941.8 6305.27 8.24484e+07 12689.5 13591.6 4164.93 14964.1 1.50774e+07 3533.22 15445.1 8.2617e+06 3389.29 5534.05 1.4291e+07 5598.5 4.59168e+06 1532.68 7.73741e+06 25879.7 1257.24 7.21312e+06 1255.26 6.95098e+06 836753 1.18394e+06 8.15647e+06 3.15465e+07
61810 20230123.49 0.77666 17196.6 41880.9 46954.3 5614.49 8.21863e+07 12732.7 12926.1 4347.21 14918.3 1.53396e+07 3505.75 15433.3 8.2617e+06 3344.53 5534.14 1.45532e+07 5551.7 4.59168e+06 1524.66 7.73741e+06 23517.7 1257.13 7.21312e+06 1264.68 6.95098e+06 839065 1.17976e+06 8.15403e+06 3.09099e+07

images

include/ccf/crypto/jwk.h Show resolved Hide resolved
js/ccf-app/test/polyfill.test.ts Show resolved Hide resolved
src/crypto/openssl/eddsa_key_pair.cpp Outdated Show resolved Hide resolved
src/crypto/openssl/key_pair.cpp Outdated Show resolved Hide resolved
src/crypto/openssl/public_key.cpp Outdated Show resolved Hide resolved
src/crypto/openssl/rsa_key_pair.cpp Outdated Show resolved Hide resolved
src/crypto/openssl/rsa_public_key.cpp Outdated Show resolved Hide resolved
@jumaffre
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jumaffre jumaffre merged commit a5ccb03 into microsoft:main Jan 24, 2023
github-actions bot pushed a commit that referenced this pull request Jan 24, 2023
(cherry picked from commit a5ccb03)
@github-actions github-actions bot added the backported This PR was successfully backported to LTS branch label Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x-todo PRs which should be backported to 3.x auto-backport Automatically backport this PR to LTS branch backported This PR was successfully backported to LTS branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a JWK public key to PEM converter in the JS API
2 participants