The pem file ``` -----BEGIN EC PRIVATE KEY----- MC4CAQEEIIX0Wk/h+GvE8RkARl4qZp+J4Ex1hjG/ZCi7mVov37teoAcGBSuBBAAK -----END EC PRIVATE KEY----- ``` My code ```python with open(fpath) as fstream: sk = SigningKey.from_pem(fstream.read(), hashlib.sha256) file = sk.to_pem() print(file) ``` This is the generates pem file ``` -----BEGIN EC PRIVATE KEY----- MHQCAQEEIIX0Wk/h+GvE8RkARl4qZp+J4Ex1hjG/ZCi7mVov37teoAcGBSuBBAAKoUQDQgAEs+tq\n5A4hqUNrlWqoo69bczY0DPxuwDXbeuxqT/HNoi9L38c8MzsSEearJzvLBrC5d6Dt/3x16vji/xAw\nONnEKQ== -----END EC PRIVATE KEY----- ``` which isn't the same as the original pem file. Can you help advise how to generate the same file ? Thank you.
Activity
tomato42 commentedon Apr 14, 2025
specify that you want to use compressed point encoding:
python-ecdsa/src/ecdsa/keys.py
Lines 1173 to 1203 in 2a6593d