decrypt

KeyManager.decrypt(message: Union[str, bytes], pad=None, hashing: cryptography.hazmat.primitives.hashes.HashAlgorithm = <cryptography.hazmat.primitives.hashes.SHA256 object>)bytes[source]

Decrypt a message using the loaded private_key - returns the decrypted message as bytes.

NOTE: Only works for RSA private keys

Parameters
  • message (str|bytes) – The ciphertext to decrypt, as base64 or raw bytes

  • pad – (RSA only) An instance of a cryptography padding class, e.g. padding.PSS

  • hashing (HashAlgorithm) – (ECDSA/RSA) Use this hashing method for padding/signatures

Return bytes decoded

The decrypted version of message as bytes