I'm trying to add a tests/hazmat/primitives/fixtures_ec.py file containing EllipticCurve fixtures for use in testing the certificate validation feature I'm working on, and I have a few questions. I'm using OpenSSL to generate EllipticCurve public/private keys, with the intent of then adding them in fixtures_ec.py as Python literals (like how fixtures_rsa.py and fixtures_dsa.py handle things).
When defining EllipticCurvePrivateNumbers, is the hex string used for the private_value argument taken verbatim from the priv field in the EllipticCurve private key file, or is it the hex of the integer produced after converting the priv hex string according to the rules in RFC 5915 and 3447? I have the same questions regarding the x and y fields of the EllipticCurvePublicNumbers object that's also needed by EllipticCurvePrivateNumbers. It's not clear to me, from looking at the RSA and DSA examples, how they're handled so without more context here I'm pretty much stuck. I tried backtracking how the EllipticCurvePrivateNumbers data is used by the backends but I didn't find anything that shed light on the situation. Also, is OpenSSL the best tool to use here for generating these test examples? It's what I've always used but if there's another tool that generates the EllipticCurve keys in the format that cryptography expects, I'm happy to switch to using that to generate the examples. Thanks for your time, Peter Hamilton
_______________________________________________ Cryptography-dev mailing list Cryptography-dev@python.org https://mail.python.org/mailman/listinfo/cryptography-dev