Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

67 linhas
2.6 KiB

  1. /* Copyright (c) 2016, Google Inc.
  2. *
  3. * Permission to use, copy, modify, and/or distribute this software for any
  4. * purpose with or without fee is hereby granted, provided that the above
  5. * copyright notice and this permission notice appear in all copies.
  6. *
  7. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  10. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  12. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  13. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
  14. #ifndef OPENSSL_HEADER_X509_INTERNAL_H
  15. #define OPENSSL_HEADER_X509_INTERNAL_H
  16. #include <openssl/base.h>
  17. #include <openssl/evp.h>
  18. #include <openssl/x509.h>
  19. #if defined(__cplusplus)
  20. extern "C" {
  21. #endif
  22. /* RSA-PSS functions. */
  23. /* x509_rsa_pss_to_ctx configures |ctx| for an RSA-PSS operation based on
  24. * signature algorithm parameters in |sigalg| (which must have type
  25. * |NID_rsassaPss|) and key |pkey|. It returns one on success and zero on
  26. * error. */
  27. int x509_rsa_pss_to_ctx(EVP_MD_CTX *ctx, X509_ALGOR *sigalg, EVP_PKEY *pkey);
  28. /* x509_rsa_pss_to_ctx sets |algor| to the signature algorithm parameters for
  29. * |ctx|, which must have been configured for an RSA-PSS signing operation. It
  30. * returns one on success and zero on error. */
  31. int x509_rsa_ctx_to_pss(EVP_MD_CTX *ctx, X509_ALGOR *algor);
  32. /* x509_print_rsa_pss_params prints a human-readable representation of RSA-PSS
  33. * parameters in |sigalg| to |bp|. It returns one on success and zero on
  34. * error. */
  35. int x509_print_rsa_pss_params(BIO *bp, const X509_ALGOR *sigalg, int indent,
  36. ASN1_PCTX *pctx);
  37. /* Signature algorithm functions. */
  38. /* x509_digest_sign_algorithm encodes the signing parameters of |ctx| as an
  39. * AlgorithmIdentifer and saves the result in |algor|. It returns one on
  40. * success, or zero on error. */
  41. int x509_digest_sign_algorithm(EVP_MD_CTX *ctx, X509_ALGOR *algor);
  42. /* x509_digest_verify_init sets up |ctx| for a signature verification operation
  43. * with public key |pkey| and parameters from |algor|. The |ctx| argument must
  44. * have been initialised with |EVP_MD_CTX_init|. It returns one on success, or
  45. * zero on error. */
  46. int x509_digest_verify_init(EVP_MD_CTX *ctx, X509_ALGOR *sigalg,
  47. EVP_PKEY *pkey);
  48. #if defined(__cplusplus)
  49. } /* extern C */
  50. #endif
  51. #endif /* OPENSSL_HEADER_X509_INTERNAL_H */