X509_NAME_ENTRY_get_object.pod 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. =pod
  2. =head1 NAME
  3. X509_NAME_ENTRY_get_object, X509_NAME_ENTRY_get_data,
  4. X509_NAME_ENTRY_set_object, X509_NAME_ENTRY_set_data,
  5. X509_NAME_ENTRY_create_by_txt, X509_NAME_ENTRY_create_by_NID,
  6. X509_NAME_ENTRY_create_by_OBJ - X509_NAME_ENTRY utility functions
  7. =head1 SYNOPSIS
  8. #include <openssl/x509.h>
  9. ASN1_OBJECT *X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne);
  10. ASN1_STRING *X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne);
  11. int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, const ASN1_OBJECT *obj);
  12. int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
  13. const unsigned char *bytes, int len);
  14. X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, const char *field,
  15. int type, const unsigned char *bytes,
  16. int len);
  17. X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid,
  18. int type, const unsigned char *bytes,
  19. int len);
  20. X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne,
  21. const ASN1_OBJECT *obj, int type,
  22. const unsigned char *bytes, int len);
  23. =head1 DESCRIPTION
  24. X509_NAME_ENTRY_get_object() retrieves the field name of B<ne> in
  25. and B<ASN1_OBJECT> structure.
  26. X509_NAME_ENTRY_get_data() retrieves the field value of B<ne> in
  27. and B<ASN1_STRING> structure.
  28. X509_NAME_ENTRY_set_object() sets the field name of B<ne> to B<obj>.
  29. X509_NAME_ENTRY_set_data() sets the field value of B<ne> to string type
  30. B<type> and value determined by B<bytes> and B<len>.
  31. X509_NAME_ENTRY_create_by_txt(), X509_NAME_ENTRY_create_by_NID()
  32. and X509_NAME_ENTRY_create_by_OBJ() create and return an
  33. B<X509_NAME_ENTRY> structure.
  34. =head1 NOTES
  35. X509_NAME_ENTRY_get_object() and X509_NAME_ENTRY_get_data() can be
  36. used to examine an B<X509_NAME_ENTRY> function as returned by
  37. X509_NAME_get_entry() for example.
  38. X509_NAME_ENTRY_create_by_txt(), X509_NAME_ENTRY_create_by_NID(),
  39. and X509_NAME_ENTRY_create_by_OBJ() create and return an
  40. X509_NAME_ENTRY_create_by_txt(), X509_NAME_ENTRY_create_by_OBJ(),
  41. X509_NAME_ENTRY_create_by_NID() and X509_NAME_ENTRY_set_data()
  42. are seldom used in practice because B<X509_NAME_ENTRY> structures
  43. are almost always part of B<X509_NAME> structures and the
  44. corresponding B<X509_NAME> functions are typically used to
  45. create and add new entries in a single operation.
  46. The arguments of these functions support similar options to the similarly
  47. named ones of the corresponding B<X509_NAME> functions such as
  48. X509_NAME_add_entry_by_txt(). So for example B<type> can be set to
  49. B<MBSTRING_ASC> but in the case of X509_set_data() the field name must be
  50. set first so the relevant field information can be looked up internally.
  51. =head1 RETURN VALUES
  52. X509_NAME_ENTRY_get_object() returns a valid B<ASN1_OBJECT> structure if it is
  53. set or NULL if an error occurred.
  54. X509_NAME_ENTRY_get_data() returns a valid B<ASN1_STRING> structure if it is set
  55. or NULL if an error occurred.
  56. X509_NAME_ENTRY_set_object() and X509_NAME_ENTRY_set_data() return 1 on success
  57. or 0 on error.
  58. X509_NAME_ENTRY_create_by_txt(), X509_NAME_ENTRY_create_by_NID() and
  59. X509_NAME_ENTRY_create_by_OBJ() return a valid B<X509_NAME_ENTRY> on success or
  60. NULL if an error occurred.
  61. =head1 SEE ALSO
  62. L<ERR_get_error(3)>, L<d2i_X509_NAME(3)>,
  63. L<OBJ_nid2obj(3)>
  64. =head1 COPYRIGHT
  65. Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.
  66. Licensed under the OpenSSL license (the "License"). You may not use
  67. this file except in compliance with the License. You can obtain a copy
  68. in the file LICENSE in the source distribution or at
  69. L<https://www.openssl.org/source/license.html>.
  70. =cut