brk-code

python-rsa の API リファレンス

python-rsa (sybrenstuvel/python-rsa) の公開 API 50 件 —— クラス 11、関数 25、メソッド 14。実際のソースを静的解析して抽出した正確なシグネチャを掲載しています。

リポジトリ: sybrenstuvel/python-rsa

種別件数
クラス11
関数25
メソッド14

API 一覧

classrsa.cli.CryptoOperation
CLI callable that operates with input, output, and a key.
methodrsa.cli.CryptoOperation.perform_operation(indata:bytes, key:rsa.key.AbstractKey, cli_args:Indexable) -> typing.Any
Performs the program's operation.
methodrsa.cli.CryptoOperation.read_infile(inname:str) -> bytes
Read the input file
methodrsa.cli.CryptoOperation.read_key(filename:str, keyform:str) -> rsa.key.AbstractKey
Reads a public or private key.
methodrsa.cli.CryptoOperation.write_outfile(outdata:bytes, outname:str) -> None
Write the output file
classrsa.cli.DecryptOperation
Decrypts a file.
methodrsa.cli.DecryptOperation.perform_operation(indata:bytes, priv_key:rsa.key.AbstractKey, cli_args:Indexable=()) -> bytes
Decrypts files.
classrsa.cli.EncryptOperation
Encrypts a file.
methodrsa.cli.EncryptOperation.perform_operation(indata:bytes, pub_key:rsa.key.AbstractKey, cli_args:Indexable=()) -> bytes
Encrypts files.
classrsa.cli.SignOperation
Signs a file.
methodrsa.cli.SignOperation.perform_operation(indata:bytes, priv_key:rsa.key.AbstractKey, cli_args:Indexable) -> bytes
Signs files.
classrsa.cli.VerifyOperation
Verify a signature.
methodrsa.cli.VerifyOperation.perform_operation(indata:bytes, pub_key:rsa.key.AbstractKey, cli_args:Indexable) -> None
Verifies files.
funcrsa.cli.keygen() -> None
Key generator.
funcrsa.common.bit_size(num:int) -> int
Number of bits needed to represent a integer excluding any prefix 0 bits.
funcrsa.common.byte_size(number:int) -> int
Returns the number of bytes required to hold a specific long number.
funcrsa.common.ceil_div(num:int, div:int) -> int
Returns the ceiling function of a division between `num` and `div`.
funcrsa.common.crt(a_values:typing.Iterable[int], modulo_values:typing.Iterable[int]) -> int
Chinese Remainder Theorem.
funcrsa.common.extended_gcd(a:int, b:int) -> typing.Tuple[int, int, int]
Returns a tuple (r, i, j) such that r = gcd(a, b) = ia + jb
funcrsa.core.encrypt_int(message:int, ekey:int, n:int) -> int
Encrypts a message using encryption key 'ekey', working modulo n
classrsa.key.AbstractKey
Abstract superclass for private and public keys.
methodrsa.key.AbstractKey.blind(message:int) -> typing.Tuple[int, int]
Performs blinding on the message.
methodrsa.key.AbstractKey.load_pkcs1(keyfile:bytes, format:str='PEM') -> T
Loads a key in PKCS#1 DER or PEM format.
methodrsa.key.AbstractKey.save_pkcs1(format:str='PEM') -> bytes
Saves the key in PKCS#1 DER or PEM format.
classrsa.key.PrivateKey
Represents a private RSA key.
methodrsa.key.PrivateKey.blinded_decrypt(encrypted:int) -> int
Decrypts the message using blinding to prevent side-channel attacks.
classrsa.key.PublicKey
Represents a public RSA key.
methodrsa.key.PublicKey.load_pkcs1_openssl_der(keyfile:bytes) -> 'PublicKey'
Loads a PKCS#1 DER-encoded public key file from OpenSSL.
methodrsa.key.PublicKey.load_pkcs1_openssl_pem(keyfile:bytes) -> 'PublicKey'
Loads a PKCS#1.5 PEM-encoded public key file from OpenSSL.
funcrsa.key.gen_keys(nbits:int, getprime_func:typing.Callable[[int], int], accurate:bool=True, exponent:int=DEFAULT_EXPONENT, nprimes:int=2) -> typing.Tuple
Generate RSA keys of nbits bits.
funcrsa.parallel.getprime(nbits:int, poolsize:int) -> int
Returns a prime number that can be stored in 'nbits' bits.
funcrsa.pem.load_pem(contents:FlexiText, pem_marker:FlexiText) -> bytes
Loads a PEM file.
funcrsa.pem.save_pem(contents:bytes, pem_marker:FlexiText) -> bytes
Saves a PEM file.
classrsa.pkcs1.CryptoError
Base class for all exceptions in this module.
classrsa.pkcs1.DecryptionError
Raised when decryption fails.
classrsa.pkcs1.VerificationError
Raised when verification fails.
funcrsa.pkcs1.compute_hash(message:typing.Union[bytes, typing.BinaryIO], method_name:str) -> bytes
Returns the message digest.
funcrsa.pkcs1.find_signature_hash(signature:bytes, pub_key:key.PublicKey) -> str
Returns the hash name detected from the signature.
funcrsa.pkcs1.sign(message:bytes, priv_key:key.PrivateKey, hash_method:str) -> bytes
Signs the message with the private key.
funcrsa.pkcs1.sign_hash(hash_value:bytes, priv_key:key.PrivateKey, hash_method:str) -> bytes
Signs a precomputed hash with the private key.
funcrsa.pkcs1.verify(message:bytes, signature:bytes, pub_key:key.PublicKey) -> str
Verifies that the signature matches the message.
funcrsa.pkcs1_v2.mgf1(seed:bytes, length:int, hasher:str='SHA-1') -> bytes
MGF1 is a Mask Generation Function based on a hash function.
funcrsa.prime.are_relatively_prime(a:int, b:int) -> bool
Returns True if a and b are relatively prime, and False if they are not.
funcrsa.prime.gcd(p:int, q:int) -> int
Returns the greatest common divisor of p and q >>> gcd(48, 180) 12
funcrsa.prime.getprime(nbits:int) -> int
Returns a prime number that can be stored in 'nbits' bits.
funcrsa.prime.is_prime(number:int) -> bool
Returns True if the number is prime, and False otherwise.
funcrsa.randnum.read_random_bits(nbits:int) -> bytes
Reads 'nbits' random bits.
funcrsa.randnum.read_random_int(nbits:int) -> int
Reads a random integer of approximately nbits bits.
funcrsa.randnum.read_random_odd_int(nbits:int) -> int
Reads a random odd integer of approximately nbits bits.
funcrsa.transform.bytes2int(raw_bytes:bytes) -> int
Converts a list of bytes or an 8-bit string to an integer.

この情報について

掲載しているシグネチャは sybrenstuvel/python-rsa の公開ソースコードを Python の ast モジュールで静的解析し、引数名・デフォルト値・ 型注釈・戻り値型をそのまま抽出したものです。実装コードは保存していません。 詳しくは仕組みの解説をご覧ください。

収録ライブラリ一覧(全 805 件)へ戻る