i2d_re_X509_tbs.pod 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. =pod
  2. =head1 NAME
  3. d2i_X509_AUX, i2d_X509_AUX,
  4. i2d_re_X509_tbs, i2d_re_X509_CRL_tbs, i2d_re_X509_REQ_tbs
  5. - X509 encode and decode functions
  6. =head1 SYNOPSIS
  7. #include <openssl/x509.h>
  8. X509 *d2i_X509_AUX(X509 **px, const unsigned char **in, long len);
  9. int i2d_X509_AUX(X509 *x, unsigned char **out);
  10. int i2d_re_X509_tbs(X509 *x, unsigned char **out);
  11. int i2d_re_X509_CRL_tbs(X509_CRL *crl, unsigned char **pp);
  12. int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp);
  13. =head1 DESCRIPTION
  14. The X509 encode and decode routines encode and parse an
  15. B<X509> structure, which represents an X509 certificate.
  16. d2i_X509_AUX() is similar to L<d2i_X509(3)> but the input is expected to
  17. consist of an X509 certificate followed by auxiliary trust information.
  18. This is used by the PEM routines to read "TRUSTED CERTIFICATE" objects.
  19. This function should not be called on untrusted input.
  20. i2d_X509_AUX() is similar to L<i2d_X509(3)>, but the encoded output
  21. contains both the certificate and any auxiliary trust information.
  22. This is used by the PEM routines to write "TRUSTED CERTIFICATE" objects.
  23. Note that this is a non-standard OpenSSL-specific data format.
  24. i2d_re_X509_tbs() is similar to L<i2d_X509(3)> except it encodes only
  25. the TBSCertificate portion of the certificate. i2d_re_X509_CRL_tbs()
  26. and i2d_re_X509_REQ_tbs() are analogous for CRL and certificate request,
  27. respectively. The "re" in B<i2d_re_X509_tbs> stands for "re-encode",
  28. and ensures that a fresh encoding is generated in case the object has been
  29. modified after creation (see the BUGS section).
  30. The encoding of the TBSCertificate portion of a certificate is cached
  31. in the B<X509> structure internally to improve encoding performance
  32. and to ensure certificate signatures are verified correctly in some
  33. certificates with broken (non-DER) encodings.
  34. If, after modification, the B<X509> object is re-signed with X509_sign(),
  35. the encoding is automatically renewed. Otherwise, the encoding of the
  36. TBSCertificate portion of the B<X509> can be manually renewed by calling
  37. i2d_re_X509_tbs().
  38. =head1 SEE ALSO
  39. L<ERR_get_error(3)>
  40. L<X509_CRL_get0_by_serial(3)>,
  41. L<X509_get0_signature(3)>,
  42. L<X509_get_ext_d2i(3)>,
  43. L<X509_get_extension_flags(3)>,
  44. L<X509_get_pubkey(3)>,
  45. L<X509_get_subject_name(3)>,
  46. L<X509_get_version(3)>,
  47. L<X509_NAME_add_entry_by_txt(3)>,
  48. L<X509_NAME_ENTRY_get_object(3)>,
  49. L<X509_NAME_get_index_by_NID(3)>,
  50. L<X509_NAME_print_ex(3)>,
  51. L<X509_new(3)>,
  52. L<X509_sign(3)>,
  53. L<X509V3_get_d2i(3)>,
  54. L<X509_verify_cert(3)>
  55. =head1 COPYRIGHT
  56. Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
  57. Licensed under the OpenSSL license (the "License"). You may not use
  58. this file except in compliance with the License. You can obtain a copy
  59. in the file LICENSE in the source distribution or at
  60. L<https://www.openssl.org/source/license.html>.
  61. =cut