MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _wrap_fernet_key

Method _wrap_fernet_key

auth_manager.py:232–235  ·  view source on GitHub ↗

Encrypt the Fernet key with a wrapping key. Returns hex string.

(fernet_key: bytes, wrapping_key: bytes)

Source from the content-addressed store, hash-verified

230
231 @staticmethod
232 def _wrap_fernet_key(fernet_key: bytes, wrapping_key: bytes) -> str:
233 """Encrypt the Fernet key with a wrapping key. Returns hex string."""
234 f = Fernet(wrapping_key)
235 return f.encrypt(fernet_key).decode('utf-8')
236
237 @staticmethod
238 def _unwrap_fernet_key(wrapped: str, wrapping_key: bytes) -> bytes:

Callers 4

setupMethod · 0.95
change_passwordMethod · 0.95
recoverMethod · 0.95

Calls 2

decodeMethod · 0.45
encryptMethod · 0.45

Tested by

no test coverage detected