Python rsa.VerificationError() Examples
The following are 13
code examples of rsa.VerificationError().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
rsa
, or try the search function
.
Example #1
Source File: licensing.py From fbs with GNU General Public License v3.0 | 5 votes |
def unpack_license_key(key_str, pubkey_args): """ Decode a string of license key data produced by `pack_license_key`. In other words, this function is the inverse of `pack_...` above: data == unpack_license_key(pack_license_key(data, ...), ...) If the given string is not a valid key, `InvalidKey` is raised. The parameter `pubkey_args` is a dictionary containing values for the RSA fields "n" and "e". It can be generated with fbs's command `init_licensing`. """ try: result = json.loads(key_str) except ValueError: raise InvalidKey() from None try: signature = result.pop('key') except KeyError: raise InvalidKey() from None try: signature_bytes = b64decode(signature.encode('ascii')) except ValueError: raise InvalidKey() from None try: rsa.verify(_dumpb(result), signature_bytes, PublicKey(**pubkey_args)) except VerificationError: raise InvalidKey() from None return result
Example #2
Source File: googleplay.py From InAppPy with MIT License | 5 votes |
def _validate_signature(self, receipt: str, signature: str) -> bool: try: sig = base64.standard_b64decode(signature) return rsa.verify(receipt.encode(), sig, self.public_key) except (rsa.VerificationError, TypeError, ValueError, BaseException): return False
Example #3
Source File: cli.py From aqua-monitor with GNU Lesser General Public License v3.0 | 5 votes |
def perform_operation(self, indata, pub_key, cli_args): """Verifies files.""" signature_file = cli_args[1] with open(signature_file, 'rb') as sigfile: signature = sigfile.read() try: rsa.verify(indata, signature, pub_key) except rsa.VerificationError: raise SystemExit('Verification failed.') print('Verification OK', file=sys.stderr)
Example #4
Source File: cli.py From baidupan_shell with GNU General Public License v2.0 | 5 votes |
def perform_operation(self, indata, pub_key, cli_args): '''Decrypts files.''' signature_file = cli_args[1] with open(signature_file, 'rb') as sigfile: signature = sigfile.read() try: rsa.verify(indata, signature, pub_key) except rsa.VerificationError: raise SystemExit('Verification failed.') print('Verification OK', file=sys.stderr)
Example #5
Source File: cli.py From bash-lambda-layer with MIT License | 5 votes |
def perform_operation(self, indata, pub_key, cli_args): """Verifies files.""" signature_file = cli_args[1] with open(signature_file, 'rb') as sigfile: signature = sigfile.read() try: rsa.verify(indata, signature, pub_key) except rsa.VerificationError: raise SystemExit('Verification failed.') print('Verification OK', file=sys.stderr)
Example #6
Source File: cli.py From xbmc-addons-chinese with GNU General Public License v2.0 | 5 votes |
def perform_operation(self, indata, pub_key, cli_args): """Verifies files.""" signature_file = cli_args[1] with open(signature_file, 'rb') as sigfile: signature = sigfile.read() try: rsa.verify(indata, signature, pub_key) except rsa.VerificationError: raise SystemExit('Verification failed.') print('Verification OK', file=sys.stderr)
Example #7
Source File: cli.py From xbmc-addons-chinese with GNU General Public License v2.0 | 5 votes |
def perform_operation(self, indata, pub_key, cli_args): """Verifies files.""" signature_file = cli_args[1] with open(signature_file, 'rb') as sigfile: signature = sigfile.read() try: rsa.verify(indata, signature, pub_key) except rsa.VerificationError: raise SystemExit('Verification failed.') print('Verification OK', file=sys.stderr)
Example #8
Source File: cli.py From luci-py with Apache License 2.0 | 5 votes |
def perform_operation(self, indata, pub_key, cli_args): '''Decrypts files.''' signature_file = cli_args[1] with open(signature_file, 'rb') as sigfile: signature = sigfile.read() try: rsa.verify(indata, signature, pub_key) except rsa.VerificationError: raise SystemExit('Verification failed.') print('Verification OK', file=sys.stderr)
Example #9
Source File: cli.py From opsbro with MIT License | 5 votes |
def perform_operation(self, indata, pub_key, cli_args): '''Decrypts files.''' signature_file = cli_args[1] with open(signature_file, 'rb') as sigfile: signature = sigfile.read() try: rsa.verify(indata, signature, pub_key) except rsa.VerificationError: raise SystemExit('Verification failed.') print('Verification OK', file=sys.stderr)
Example #10
Source File: googleplay.py From pyinapp with MIT License | 5 votes |
def _validate_signature(self, receipt, signature): try: sig = base64.standard_b64decode(signature) return rsa.verify(receipt.encode(), sig, self.public_key) except (rsa.VerificationError, TypeError): return False
Example #11
Source File: cli.py From plugin.video.bdyun with GNU General Public License v3.0 | 5 votes |
def perform_operation(self, indata, pub_key, cli_args): """Verifies files.""" signature_file = cli_args[1] with open(signature_file, 'rb') as sigfile: signature = sigfile.read() try: rsa.verify(indata, signature, pub_key) except rsa.VerificationError: raise SystemExit('Verification failed.') print('Verification OK', file=sys.stderr)
Example #12
Source File: cli.py From jarvis with GNU General Public License v2.0 | 5 votes |
def perform_operation(self, indata, pub_key, cli_args): """Verifies files.""" signature_file = cli_args[1] with open(signature_file, 'rb') as sigfile: signature = sigfile.read() try: rsa.verify(indata, signature, pub_key) except rsa.VerificationError: raise SystemExit('Verification failed.') print('Verification OK', file=sys.stderr)
Example #13
Source File: cli.py From aws-kube-codesuite with Apache License 2.0 | 5 votes |
def perform_operation(self, indata, pub_key, cli_args): """Verifies files.""" signature_file = cli_args[1] with open(signature_file, 'rb') as sigfile: signature = sigfile.read() try: rsa.verify(indata, signature, pub_key) except rsa.VerificationError: raise SystemExit('Verification failed.') print('Verification OK', file=sys.stderr)