1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-03-03 14:52:36 +02:00

remove newline

This commit is contained in:
Florent Daigniere 2022-11-29 13:32:40 +01:00 committed by GitHub
parent 3e38e7b89d
commit b553d025eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]