-
Notifications
You must be signed in to change notification settings - Fork 376
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
Implement Elliptic Curve Crypto Signatures #74
Conversation
Thank you very much! Code review in progress. :) |
@@ -37,10 +45,22 @@ def sign_rsa(algorithm, msg, private_key) | |||
private_key.sign(OpenSSL::Digest.new(algorithm.sub('RS', 'sha')), msg) | |||
end | |||
|
|||
def sign_ecdsa(algorithm, msg, private_key) | |||
raise IncorrectAlgorithm unless NAMED_CURVES[algorithm] == private_key.group.curve_name |
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.
Now that I look back at this. It would probably be better to raise this with a more helpful message.
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.
Feel free to extend you PR.
I can tag it as WIP if you want to. :)
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.
Sounds good, I'll update my branch. It shouldn't take me very long.
The JSON Web Algorithms draft specifies three algorithms for signatures using the Elliptic Curve Digital Signature Algorithm (ECDSA). * ES256 - ECDSA using P-256 and SHA-256 * ES384 - ECDSA using P-384 and SHA-384 * ES512 - ECDSA using P-521 and SHA-512
32749d5
to
190298a
Compare
@excpt I've pushed an update that includes the better error message |
👍 |
Implement Elliptic Curve Crypto Signatures
@jtdowney Thank you for the contribution. Merged and released in version 1.5.0. :) 🍻 |
The JSON Web Algorithms draft specifies three algorithms for signatures using the Elliptic Curve Digital Signature Algorithm (ECDSA). This pull request adds support for: