Add DSA
Things that need to happen;
- [x] OpenSSL bindings
- [x] Interfaces for key objects
- [x] Key generation
- [x] test vectors
- [x] Signature API
- [x] Verification API
First hard API design question:
RSAPrivateKey objects have a public_key method which returns an RSAPublicKey. Presumably we'd like to have the same on DSAPrivateKey. Unfortunately DSA keys contain a member (y) which is also typically known by public_key.
It seems we have three choices:
- Be inconsistent with typical naming conventions around DSA
- Be inconsistent with the RSA API
- Change the RSA API as well
Opinions?
What APIs call only the bare y a public key?
Seems like public_key should return a DSAPublicKey and that y parameter should just be y to me.
It'd be nice to store the DSA params as an object, which then makes DSAPublicKey a more useful object.
private_key = dsa.DSAPrivateKey.generate(2048, backend)
params = private_key.params()
public_key = private_key.public_key()
same_params = public_key.params()
print(params.p)
print(same_params.p)
@reaperhulk agreed.
@public We've typically tried to offer the more verbose name whenever possible here, PyCrypto's docs describe y as Public key (y), I haven't seen any other reference on this.
@alex I think the to-do list needs to be updated?
I've updated the list.
@reaperhulk Awesome, thanks :)
I guess we're done here.
High fives all round.