X509_NAME_ENTRY_get_object.pod 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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_OBJ(),
  39. X509_NAME_ENTRY_create_by_NID() and X509_NAME_ENTRY_set_data()
  40. are seldom used in practice because B<X509_NAME_ENTRY> structures
  41. are almost always part of B<X509_NAME> structures and the
  42. corresponding B<X509_NAME> functions are typically used to
  43. create and add new entries in a single operation.
  44. The arguments of these functions support similar options to the similarly
  45. named ones of the corresponding B<X509_NAME> functions such as
  46. X509_NAME_add_entry_by_txt(). So for example B<type> can be set to
  47. B<MBSTRING_ASC> but in the case of X509_set_data() the field name must be
  48. set first so the relevant field information can be looked up internally.
  49. =head1 RETURN VALUES
  50. X509_NAME_ENTRY_get_object() returns a valid B<ASN1_OBJECT> structure if it is
  51. set or NULL if an error occurred.
  52. X509_NAME_ENTRY_get_data() returns a valid B<ASN1_STRING> structure if it is set
  53. or NULL if an error occurred.
  54. X509_NAME_ENTRY_set_object() and X509_NAME_ENTRY_set_data() return 1 on success
  55. or 0 on error.
  56. X509_NAME_ENTRY_create_by_txt(), X509_NAME_ENTRY_create_by_NID() and
  57. X509_NAME_ENTRY_create_by_OBJ() return a valid B<X509_NAME_ENTRY> on success or
  58. NULL if an error occurred.
  59. =head1 SEE ALSO
  60. L<ERR_get_error(3)>, L<d2i_X509_NAME(3)>,
  61. L<OBJ_nid2obj(3)>
  62. =head1 COPYRIGHT
  63. Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.
  64. Licensed under the Apache License 2.0 (the "License"). You may not use
  65. this file except in compliance with the License. You can obtain a copy
  66. in the file LICENSE in the source distribution or at
  67. L<https://www.openssl.org/source/license.html>.
  68. =cut