X509_digest.pod 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. =pod
  2. =head1 NAME
  3. X509_digest, X509_CRL_digest,
  4. X509_pubkey_digest,
  5. X509_NAME_digest,
  6. X509_REQ_digest,
  7. PKCS7_ISSUER_AND_SERIAL_digest
  8. - get digest of various objects
  9. =head1 SYNOPSIS
  10. #include <openssl/x509.h>
  11. int X509_digest(const X509 *data, const EVP_MD *type, unsigned char *md,
  12. unsigned int *len);
  13. int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type, unsigned char *md,
  14. unsigned int *len);
  15. int X509_pubkey_digest(const X509 *data, const EVP_MD *type,
  16. unsigned char *md, unsigned int *len);
  17. int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type,
  18. unsigned char *md, unsigned int *len);
  19. int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type,
  20. unsigned char *md, unsigned int *len);
  21. #include <openssl/pkcs7.h>
  22. int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,
  23. const EVP_MD *type, unsigned char *md,
  24. unsigned int *len);
  25. =head1 DESCRIPTION
  26. X509_pubkey_digest() returns a digest of the DER representation of the public
  27. key in the specified X509 B<data> object.
  28. All other functions described here return a digest of the DER representation
  29. of their entire B<data> objects.
  30. The B<type> parameter specifies the digest to
  31. be used, such as EVP_sha1(). The B<md> is a pointer to the buffer where the
  32. digest will be copied and is assumed to be large enough; the constant
  33. B<EVP_MAX_MD_SIZE> is suggested. The B<len> parameter, if not NULL, points
  34. to a place where the digest size will be stored.
  35. =head1 RETURN VALUES
  36. All functions described here return 1 for success and 0 for failure.
  37. =head1 SEE ALSO
  38. L<EVP_sha1(3)>
  39. =head1 COPYRIGHT
  40. Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
  41. Licensed under the OpenSSL license (the "License"). You may not use
  42. this file except in compliance with the License. You can obtain a copy
  43. in the file LICENSE in the source distribution or at
  44. L<https://www.openssl.org/source/license.html>.
  45. =cut