示例#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)
示例#2
0
文件: rsa.py 项目: DamirAinullin/PTVS
 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
     )
示例#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
     )
示例#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)
示例#5
0
文件: rsa.py 项目: Ma233/cryptography
 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)
示例#6
0
文件: ec.py 项目: 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)
示例#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)
示例#8
0
文件: ec.py 项目: docovarr2020/DIYnow
 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)
示例#9
0
文件: rsa.py 项目: Ma233/cryptography
 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)
示例#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
     )
示例#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)
示例#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)
示例#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)
示例#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)
示例#15
0
文件: rsa.py 项目: DamirAinullin/PTVS
 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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)