I am trying to convert a raw private ecdsa key in hex format (k) to a PEM file. I searched for few hours, but couldn't find a suitable library(Python prefered). I am using python-ecdsa but I there is just a function to parse r,s out of signatures. Do you know any library that is capable of doing that?
closed as off-topic by Steffen Ullrich, Steve, S.L. Barth, grochmal, Xander Jan 10 '17 at 21:35
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions seeking product recommendations are off-topic as they become obsolete quickly. Instead, describe your situation and the specific problem you're trying to solve." – S.L. Barth, grochmal
I found a solution now. You can simply use:
private_key = SigningKey.from_secret_exponent(k, curve=...)
After that you can call functions like priv.to_pem()