From ca835a69df2f5c94644f797cbaa274ba357269d0 Mon Sep 17 00:00:00 2001 From: mwiegand Date: Fri, 4 Mar 2022 08:48:18 +0100 Subject: [PATCH] cache generate_ed25519_key_pair --- libs/ssh.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/ssh.py b/libs/ssh.py index 5bfcaa6..c4c62d4 100644 --- a/libs/ssh.py +++ b/libs/ssh.py @@ -1,10 +1,12 @@ from base64 import b64decode, b64encode from hashlib import sha3_224 +from functools import cache from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey from cryptography.hazmat.primitives.serialization import Encoding, PrivateFormat, PublicFormat, NoEncryption +@cache def generate_ed25519_key_pair(secret): privkey_bytes = Ed25519PrivateKey.from_private_bytes(secret)