forked from ByteInternet/drf-oidc-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
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")
Metadata
Metadata
Assignees
Labels
No labels