I am getting ValueError("Could not deserialize key data.") if I use load_pem_private_key from from cryptography.hazmat.primitives.serialization
To add more context:
My key starts with
-----BEGIN OPENSSH PRIVATE KEY-----
The code segment that raises this Error
key = serialization.load_pem_private_key(data=private_key.encode(),
password=None,
backend=default_backend())
The traceback of the error shows
backend=default_backend()) -> return backend.load_pem_private_key(data, password) in load_pem_private_key -> password, in load_pem_private_key -> self._handle_key_loading_error() in _load_key