MCPcopy
hub / github.com/celery/celery / __init__

Method __init__

celery/security/key.py:15–25  ·  view source on GitHub ↗
(self, key, password=None)

Source from the content-addressed store, hash-verified

13 """Represents a private key."""
14
15 def __init__(self, key, password=None):
16 with reraise_errors(
17 'Invalid private key: {0!r}', errors=(ValueError,)
18 ):
19 self._key = serialization.load_pem_private_key(
20 ensure_bytes(key),
21 password=ensure_bytes(password),
22 backend=default_backend())
23
24 if not isinstance(self._key, rsa.RSAPrivateKey):
25 raise ValueError("Non-RSA keys are not supported.")
26
27 def sign(self, data, digest):
28 """Sign string containing data."""

Callers

nothing calls this directly

Calls 1

reraise_errorsFunction · 0.85

Tested by

no test coverage detected