'AWS KMS convert private key PEM to DER format

I have private keys in the format of JWK and ethereum key, and I need to use python to convert it to DER format that matches with private key returned from the generate_key_pair method of KMS for consistency in my system. How to do that?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source