Ejemplo n.º 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)
Ejemplo n.º 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
     )
Ejemplo n.º 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
     )
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 6
0
Archivo: ec.py Proyecto: 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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
     )
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)