Here is a requirement to sign a private key and text with “SHA256WithRSA” algo. But after doing many search over the documentation of k6 I didn’t find any algo “SHA256WithRSA”
sorry, this scheme is not supported natively in k6. A workaround might be to do the signing outside of k6 and then load the file with
open() in the script.
Hope it helps you achieve your goals.
Just to elaborate a bit more on @mostafa’s suggestion:
Hi, I have this problem also and find to using modules but when running the test it’s stuck. Did you found the solution?
Can you provide more information, so that I can help you?
I have an issue about signing with RS256. Currently k6 crypto modules only support HMAC. Then I’m trying to import modules node-rsa that support this functionality and bundle the js with a webpack. But, when I run k6 run with the bundle it’s stuck and do nothing.
If you have any idea how to implement RS256 in k6 with another way, I’m happy to listen also.
note: I need the RS256 signing result will be use as one of the parameter in the header for the http request.
k6 does not support NodeJS API, therefore this package won’t work on k6.
@mostafa any alternative way in k6 if I want to use RS256 for signing?
Try this one:
The last resort would be to wait for the plug-in support PR to be merged.
@mostafa thx for the advice. With some small modification in jsencrypt (take out window and navigator stuff), now I’m able to execute rs256.
Thanks for the guidance.
This is also worth being mentioned here if you want a complete example, although it uses
crypto-js and not
done to post the code there