foxhole/key.py
SouthFox fb8e72d2ff [WIP]WIP
- init profile
- receive ap_object
2022-11-23 01:06:19 +08:00

9 lines
241 B
Python

#!/usr/bin/env python3
from pathlib import Path
from Crypto.PublicKey import RSA
def get_pubkey_as_pem(key_path: Path) -> str:
text = key_path.read_text()
return RSA.import_key(text).public_key().export_key("PEM").decode("utf-8")