Open stveit opened 8 months ago
I think its possible to replace this:
def get_public_key(key): """Returns public key for a RSAKey object""" public_key = key.get_public_key().public_bytes( encoding=crypto_serialization.Encoding.PEM, format= crypto_serialization.PublicFormat.SubjectPublicKeyInfo, ).decode("utf-8") return public_key
with this:
def get_public_key(key): """Returns public key for a RSAKey object""" public_key = key.as_bytes(is_private=False).decode("utf-8") return public_key
based on this working to extract private key in PEM format from a RSAKey object with:
private_key.as_bytes(is_private=True).decode("utf-8")
I think its possible to replace this:
with this:
based on this working to extract private key in PEM format from a RSAKey object with: