Example #1
0
 def verify(self, signature, data, padding, algorithm):
     padding_enum = _rsa_sig_determine_padding(self._backend, self, padding,
                                               algorithm)
     data, algorithm = _calculate_digest_and_algorithm(
         self._backend, data, algorithm)
     return _rsa_sig_verify(self._backend, padding, padding_enum, algorithm,
                            self, signature, data)
Example #2
0
 def verify(self, signature, data, padding, algorithm):
     data, algorithm = _calculate_digest_and_algorithm(
         self._backend, data, algorithm
     )
     return _rsa_sig_verify(
         self._backend, padding, algorithm, self, signature, data
     )
Example #3
0
 def verify(self, signature, data, padding, algorithm):
     data, algorithm = _calculate_digest_and_algorithm(
         self._backend, data, algorithm
     )
     return _rsa_sig_verify(
         self._backend, padding, algorithm, self, signature, data
     )
Example #4
0
 def sign(
     self,
     data: bytes,
     algorithm: typing.Union[asym_utils.Prehashed, hashes.HashAlgorithm],
 ) -> bytes:
     data, algorithm = _calculate_digest_and_algorithm(
         self._backend, data, algorithm)
     return _dsa_sig_sign(self._backend, self, data)
Example #5
0
 def sign(
     self,
     data: bytes,
     padding: AsymmetricPadding,
     algorithm: typing.Union[asym_utils.Prehashed, hashes.HashAlgorithm],
 ) -> bytes:
     data, algorithm = _calculate_digest_and_algorithm(data, algorithm)
     return _rsa_sig_sign(self._backend, padding, algorithm, self, data)
Example #6
0
File: ec.py Project: reidefe/foxy
 def sign(self, data: bytes,
          signature_algorithm: ec.EllipticCurveSignatureAlgorithm) -> bytes:
     _check_signature_algorithm(signature_algorithm)
     data, algorithm = _calculate_digest_and_algorithm(
         self._backend,
         data,
         signature_algorithm._algorithm,  # type: ignore[attr-defined]
     )
     return _ecdsa_sig_sign(self._backend, self, data)
Example #7
0
 def verify(
     self,
     signature: bytes,
     data: bytes,
     algorithm: typing.Union[asym_utils.Prehashed, hashes.HashAlgorithm],
 ):
     data, algorithm = _calculate_digest_and_algorithm(
         self._backend, data, algorithm)
     return _dsa_sig_verify(self._backend, self, signature, data)
Example #8
0
 def verify(self, signature, data, signature_algorithm):
     _check_signature_algorithm(signature_algorithm)
     data, algorithm = _calculate_digest_and_algorithm(
         self._backend, data, signature_algorithm._algorithm
     )
     data = _truncate_digest_for_ecdsa(
         self._ec_key, data, self._backend
     )
     return _ecdsa_sig_verify(self._backend, self, signature, data)
Example #9
0
 def verify(
     self,
     signature: bytes,
     data: bytes,
     padding: AsymmetricPadding,
     algorithm: typing.Union[asym_utils.Prehashed, hashes.HashAlgorithm],
 ) -> None:
     data, algorithm = _calculate_digest_and_algorithm(data, algorithm)
     _rsa_sig_verify(self._backend, padding, algorithm, self, signature,
                     data)
Example #10
0
 def verify(self, signature, data, padding, algorithm):
     padding_enum = _rsa_sig_determine_padding(
         self._backend, self, padding, algorithm
     )
     data, algorithm = _calculate_digest_and_algorithm(
         self._backend, data, algorithm
     )
     return _rsa_sig_verify(
         self._backend, padding, padding_enum, algorithm, self,
         signature, data
     )
Example #11
0
 def sign(
     self,
     data: bytes,
     signature_algorithm: ec.EllipticCurveSignatureAlgorithm,
 ) -> bytes:
     _check_signature_algorithm(signature_algorithm)
     data, _ = _calculate_digest_and_algorithm(
         data,
         signature_algorithm.algorithm,
     )
     return _ecdsa_sig_sign(self._backend, self, data)
Example #12
0
 def verify(
     self,
     signature: bytes,
     data: bytes,
     signature_algorithm: ec.EllipticCurveSignatureAlgorithm,
 ) -> None:
     _check_signature_algorithm(signature_algorithm)
     data, _ = _calculate_digest_and_algorithm(
         data,
         signature_algorithm.algorithm,
     )
     _ecdsa_sig_verify(self._backend, self, signature, data)
Example #13
0
 def verify(
     self,
     signature: bytes,
     data: bytes,
     signature_algorithm: ec.EllipticCurveSignatureAlgorithm,
 ) -> None:
     _check_signature_algorithm(signature_algorithm)
     data, algorithm = _calculate_digest_and_algorithm(
         self._backend,
         data,
         signature_algorithm._algorithm,  # type: ignore[attr-defined]
     )
     _ecdsa_sig_verify(self._backend, self, signature, data)
Example #14
0
 def sign(self, data, padding, algorithm):
     data, algorithm = _calculate_digest_and_algorithm(
         self._backend, data, algorithm
     )
     return _rsa_sig_sign(self._backend, padding, algorithm, self, data)
Example #15
0
 def sign(self, data, padding, algorithm):
     data, algorithm = _calculate_digest_and_algorithm(
         self._backend, data, algorithm
     )
     return _rsa_sig_sign(self._backend, padding, algorithm, self, data)
Example #16
0
 def verify(self, signature, data, signature_algorithm):
     _check_signature_algorithm(signature_algorithm)
     data, algorithm = _calculate_digest_and_algorithm(
         self._backend, data, signature_algorithm._algorithm)
     _ecdsa_sig_verify(self._backend, self, signature, data)
Example #17
0
 def sign(self, data, signature_algorithm):
     _check_signature_algorithm(signature_algorithm)
     data, algorithm = _calculate_digest_and_algorithm(
         self._backend, data, signature_algorithm._algorithm)
     return _ecdsa_sig_sign(self._backend, self, data)
Example #18
0
 def sign(self, data, signature_algorithm):
     _check_signature_algorithm(signature_algorithm)
     data, algorithm = _calculate_digest_and_algorithm(
         self._backend, data, signature_algorithm._algorithm
     )
     return _ecdsa_sig_sign(self._backend, self, data)
Example #19
0
 def verify(self, signature, data, algorithm):
     data, algorithm = _calculate_digest_and_algorithm(
         self._backend, data, algorithm
     )
     data = _truncate_digest_for_dsa(self._dsa_cdata, data, self._backend)
     return _dsa_sig_verify(self._backend, self, signature, data)
Example #20
0
 def verify(self, signature, data, algorithm):
     data, algorithm = _calculate_digest_and_algorithm(
         self._backend, data, algorithm)
     data = _truncate_digest_for_dsa(self._dsa_cdata, data, self._backend)
     return _dsa_sig_verify(self._backend, self, signature, data)
Example #21
0
 def verify(self, signature, data, signature_algorithm):
     _check_signature_algorithm(signature_algorithm)
     data, algorithm = _calculate_digest_and_algorithm(
         self._backend, data, signature_algorithm._algorithm
     )
     _ecdsa_sig_verify(self._backend, self, signature, data)