💾 Archived View for tris.fyi › pydoc › cryptography.hazmat.primitives.asymmetric.rsa captured on 2023-01-29 at 04:18:00. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2022-07-16)
-=-=-=-=-=-=-
cryptography.hazmat.primitives.asymmetric
cryptography.hazmat.primitives
This module has no docstring.
name = <abc.abstractproperty object at 0x7f75e313b8e0> A string naming this padding (e.g. "PSS", "PKCS1").
decrypt(self, ciphertext: bytes, padding: cryptography.hazmat.primitives._asymmetric.AsymmetricPadding) -> bytes Decrypts the provided ciphertext.
private_bytes(self, encoding: cryptography.hazmat.primitives._serialization.Encoding, format: cryptography.hazmat.primitives._serialization.PrivateFormat, encryption_algorithm: cryptography.hazmat.primitives._serialization.KeySerializationEncryption) -> bytes Returns the key serialized as bytes.
private_numbers(self) -> 'RSAPrivateNumbers' Returns an RSAPrivateNumbers.
public_key(self) -> 'RSAPublicKey' The RSAPublicKey associated with this private key.
sign(self, data: bytes, padding: cryptography.hazmat.primitives._asymmetric.AsymmetricPadding, algorithm: Union[cryptography.hazmat.primitives.asymmetric.utils.Prehashed, cryptography.hazmat.primitives.hashes.HashAlgorithm]) -> bytes Signs the data.
key_size = <abc.abstractproperty object at 0x7f75e313b940> The bit length of the public modulus.
decrypt(self, ciphertext: bytes, padding: cryptography.hazmat.primitives._asymmetric.AsymmetricPadding) -> bytes Decrypts the provided ciphertext.
private_bytes(self, encoding: cryptography.hazmat.primitives._serialization.Encoding, format: cryptography.hazmat.primitives._serialization.PrivateFormat, encryption_algorithm: cryptography.hazmat.primitives._serialization.KeySerializationEncryption) -> bytes Returns the key serialized as bytes.
private_numbers(self) -> 'RSAPrivateNumbers' Returns an RSAPrivateNumbers.
public_key(self) -> 'RSAPublicKey' The RSAPublicKey associated with this private key.
sign(self, data: bytes, padding: cryptography.hazmat.primitives._asymmetric.AsymmetricPadding, algorithm: Union[cryptography.hazmat.primitives.asymmetric.utils.Prehashed, cryptography.hazmat.primitives.hashes.HashAlgorithm]) -> bytes Signs the data.
key_size = <abc.abstractproperty object at 0x7f75e313b940> The bit length of the public modulus.
private_key(self, backend: Any = None) -> cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey
d = <property object at 0x7f75e2db0ea0>
dmp1 = <property object at 0x7f75e2db0ef0>
dmq1 = <property object at 0x7f75e2db0f40>
iqmp = <property object at 0x7f75e2db0f90>
p = <property object at 0x7f75e2db0bd0>
public_numbers = <property object at 0x7f75e2db0fe0>
q = <property object at 0x7f75e2db0d60>
encrypt(self, plaintext: bytes, padding: cryptography.hazmat.primitives._asymmetric.AsymmetricPadding) -> bytes Encrypts the given plaintext.
public_bytes(self, encoding: cryptography.hazmat.primitives._serialization.Encoding, format: cryptography.hazmat.primitives._serialization.PublicFormat) -> bytes Returns the key serialized as bytes.
public_numbers(self) -> 'RSAPublicNumbers' Returns an RSAPublicNumbers
recover_data_from_signature(self, signature: bytes, padding: cryptography.hazmat.primitives._asymmetric.AsymmetricPadding, algorithm: Optional[cryptography.hazmat.primitives.hashes.HashAlgorithm]) -> bytes Recovers the original data from the signature.
verify(self, signature: bytes, data: bytes, padding: cryptography.hazmat.primitives._asymmetric.AsymmetricPadding, algorithm: Union[cryptography.hazmat.primitives.asymmetric.utils.Prehashed, cryptography.hazmat.primitives.hashes.HashAlgorithm]) -> None Verifies the signature of the data.
key_size = <abc.abstractproperty object at 0x7f75e313ba60> The bit length of the public modulus.
encrypt(self, plaintext: bytes, padding: cryptography.hazmat.primitives._asymmetric.AsymmetricPadding) -> bytes Encrypts the given plaintext.
public_bytes(self, encoding: cryptography.hazmat.primitives._serialization.Encoding, format: cryptography.hazmat.primitives._serialization.PublicFormat) -> bytes Returns the key serialized as bytes.
public_numbers(self) -> 'RSAPublicNumbers' Returns an RSAPublicNumbers
recover_data_from_signature(self, signature: bytes, padding: cryptography.hazmat.primitives._asymmetric.AsymmetricPadding, algorithm: Optional[cryptography.hazmat.primitives.hashes.HashAlgorithm]) -> bytes Recovers the original data from the signature.
verify(self, signature: bytes, data: bytes, padding: cryptography.hazmat.primitives._asymmetric.AsymmetricPadding, algorithm: Union[cryptography.hazmat.primitives.asymmetric.utils.Prehashed, cryptography.hazmat.primitives.hashes.HashAlgorithm]) -> None Verifies the signature of the data.
key_size = <abc.abstractproperty object at 0x7f75e313ba60> The bit length of the public modulus.
public_key(self, backend: Any = None) -> cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey
e = <property object at 0x7f75e2db1080>
n = <property object at 0x7f75e2db10d0>
gcd(*integers) Greatest Common Divisor.
generate_private_key(public_exponent: int, key_size: int, backend: Any = None) -> cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey
rsa_crt_dmp1(private_exponent: int, p: int) -> int Compute the CRT private_exponent % (p - 1) value from the RSA private_exponent (d) and p.
rsa_crt_dmq1(private_exponent: int, q: int) -> int Compute the CRT private_exponent % (q - 1) value from the RSA private_exponent (d) and q.
rsa_crt_iqmp(p: int, q: int) -> int Compute the CRT (q ** -1) % p value from RSA primes p and q.
rsa_recover_prime_factors(n: int, e: int, d: int) -> Tuple[int, int] Compute factors p and q from the private exponent d. We assume that n has no more than two factors. This function is adapted from code in PyCrypto.