Encrypt the Fernet key with a wrapping key. Returns hex string.
(fernet_key: bytes, wrapping_key: bytes)
| 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: |
no test coverage detected