Generate private key from Python client

This commit is contained in:
2024-06-30 09:46:15 +02:00
parent 4c4d1e13cb
commit 426c25fce5
4 changed files with 16 additions and 5 deletions

6
python_device/src/pki.py Normal file
View File

@ -0,0 +1,6 @@
from OpenSSL import crypto
def gen_priv_key():
key = crypto.PKey()
key.generate_key(crypto.TYPE_RSA, 2048)
return crypto.dump_privatekey(crypto.FILETYPE_PEM, key).decode("utf-8")