-
Notifications
You must be signed in to change notification settings - Fork 419
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 Elliptic Curve support to PKey #195
Conversation
2 similar comments
Add support for TYPE_EC to PKey Add tests for TYPE_EC PKey Add documentation for TYPE_EC PKey Add ChangeLog entry for TYPE_EC PKey Pick some curves for the test_regeneration
1 similar comment
:param type: The key type (TYPE_RSA or TYPE_DSA) | ||
:param bits: The number of bits | ||
:param type: The key type (TYPE_RSA or TYPE_DSA or TYPE_EC) | ||
:param bits: The number of bits or EllipticCurve |
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.
If I was specifying a curve, I'm not sure if I would know how I would do it, based on this. If I was using RSA I would specify something like "2048". If I was specifying a curve, I would specify what? "secp384r1"? I'm not sure if I have a better alternative though or a suggestion for where you should take it.
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.
I agree, it's not the greatest approach.
The current implementation is used as follows:
curve = OpenSSL.crypto.get_elliptic_curve('secp384r1')
pkey = PKey()
pkey.generate(key, TYPE_EC, curve)
Honestly I think the best approach would be to subclass PKey
into RSAPKey
, DSAPKey
, and ECPKey
but that is getting away from the thin abstraction on top of OpenSSL.
I believe this has been fixed via #439. Sorry for the inappropriate process! |
This is a rewrite of an older PR that adds EC support to PKey to incorporate the inclusion of _EllipticCurve objects.