You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm passing in a RSAKey object to Signature.init() and it fails with
Uncaught init failed.:[object Object]
My code looks like this:
// in browser, using browserify.varrsa=require("jsrsasign");varkeypair=rsa.KEYUTIL.generateKeypair("RSA",256);console.log(keypair.prvKeyObj);varsignature=newrsa.Signature({alg: "MD5withRSA"});signature.init(keypair.prvKeyObj);// ERROR HEREsignature.updateString("Hello");varsignatureValue=signature.sign();console.log(signatureValue);
Why might the init fail?
The text was updated successfully, but these errors were encountered:
I've tried your code on Node and gotten error like "key is too short for SigAlg".
Your RSA key seems to short for PKCS#1 padding for MD5withRSA.
For example key length is 512bit, it works fine.
I'm passing in a RSAKey object to Signature.init() and it fails with
My code looks like this:
Why might the init fail?
The text was updated successfully, but these errors were encountered: