-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
added support for RSA signatures. #16
base: master
Are you sure you want to change the base?
Conversation
Thank you for your contribution. I think I can accept this once myself and maybe some other people have time to test it and verify that it works as it should. There are a few things that need to be fixed with regard to coding standards, but I will put those in other comments. |
return digest == digestMethod(text); | ||
} | ||
|
||
RSAKey.prototype.verify = RSAVerify; |
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.
Why not just assign the function directly instead of having a separate function? Something like this?
RSAKey.prototype.verify = function(text, signature, digestMethod) {
var c = parseBigInt(signature, 16);
var m = c.modPowInt(this.e, this.n);
if (m == null) return null;
var digest = pkcs1unpad2(m, (this.n.bitLength()+7)>>3);
console.log("RSAVerify: message digest :- " + digest);
return digest == digestMethod(text);
};
Same goes for the other function you created.
…formatting for private key operations was being done wrongly.
+1 ? |
+1 |
You example is always returning false |
+1 |
-er- any way I could help to get this updated and merged? Really need the signing feature. |
@khatribharat Any chance you could fix those conflicts? |
Please rebase against master using TypeScript. |
the digest method
it works fine, if we use |
I've added support for RSA signatures.
Usage :