remove newline

main
Florent Daigniere 2 years ago committed by GitHub
parent 3e38e7b89d
commit b553d025eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,7 +16,6 @@ def gen_key(bits=2048):
def strip_key(pem):
""" Return only the b64 part of the ASCII armored PEM.
"""
priv_key = serialization.load_pem_private_key(pem, password=None)
public_pem = priv_key.public_key().public_bytes(encoding=serialization.Encoding.PEM,format=serialization.PublicFormat.SubjectPublicKeyInfo)
return public_pem.replace(b"\n", b"").split(b"-----")[2]

Loading…
Cancel
Save