A
A
Aryeh Leonid R.2020-06-15 13:31:04
Python
Aryeh Leonid R., 2020-06-15 13:31:04

How to convert elliptical key from PER to DER format?

There is a pair (public and private) of elliptical keys in PEM format (files on disk).
You need to get the public key file in DER format.
In the OpenSSL command line, the task is not difficult to solve:

#!/bin/bash
openssl ec -in x-priv.pem -pubout -outform DER -out x-pub.der

But I need platform independent solution in Python 3 environment, cryptography.hazmat is loaded, but other extensions can be used.
Can someone suggest a solution?

UPD . The question is closed. Wrote it myself, used cryptography.hazmat
No more than 20 lines of code including error handling.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pfg21, 2020-06-15
@pfg21

google libraries for them?? or learn der pem format and make them yourself??

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question