OSSL_STORE_INFO.pod 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. =pod
  2. =head1 NAME
  3. OSSL_STORE_INFO, OSSL_STORE_INFO_get_type, OSSL_STORE_INFO_get0_NAME,
  4. OSSL_STORE_INFO_get0_NAME_description, OSSL_STORE_INFO_get0_PARAMS,
  5. OSSL_STORE_INFO_get0_PKEY, OSSL_STORE_INFO_get0_CERT, OSSL_STORE_INFO_get0_CRL,
  6. OSSL_STORE_INFO_get1_NAME, OSSL_STORE_INFO_get1_NAME_description,
  7. OSSL_STORE_INFO_get1_PARAMS, OSSL_STORE_INFO_get1_PKEY,
  8. OSSL_STORE_INFO_get1_CERT,
  9. OSSL_STORE_INFO_get1_CRL, OSSL_STORE_INFO_type_string, OSSL_STORE_INFO_free,
  10. OSSL_STORE_INFO_new_NAME, OSSL_STORE_INFO_set0_NAME_description,
  11. OSSL_STORE_INFO_new_PARAMS, OSSL_STORE_INFO_new_PKEY, OSSL_STORE_INFO_new_CERT,
  12. OSSL_STORE_INFO_new_CRL - Functions to manipulate OSSL_STORE_INFO objects
  13. =head1 SYNOPSIS
  14. #include <openssl/store.h>
  15. typedef struct ossl_store_info_st OSSL_STORE_INFO;
  16. int OSSL_STORE_INFO_get_type(const OSSL_STORE_INFO *store_info);
  17. const char *OSSL_STORE_INFO_get0_NAME(const OSSL_STORE_INFO *store_info);
  18. char *OSSL_STORE_INFO_get1_NAME(const OSSL_STORE_INFO *store_info);
  19. const char *OSSL_STORE_INFO_get0_NAME_description(const OSSL_STORE_INFO
  20. *store_info);
  21. char *OSSL_STORE_INFO_get1_NAME_description(const OSSL_STORE_INFO *store_info);
  22. EVP_PKEY *OSSL_STORE_INFO_get0_PARAMS(const OSSL_STORE_INFO *store_info);
  23. EVP_PKEY *OSSL_STORE_INFO_get1_PARAMS(const OSSL_STORE_INFO *store_info);
  24. EVP_PKEY *OSSL_STORE_INFO_get0_PKEY(const OSSL_STORE_INFO *store_info);
  25. EVP_PKEY *OSSL_STORE_INFO_get1_PKEY(const OSSL_STORE_INFO *store_info);
  26. X509 *OSSL_STORE_INFO_get0_CERT(const OSSL_STORE_INFO *store_info);
  27. X509 *OSSL_STORE_INFO_get1_CERT(const OSSL_STORE_INFO *store_info);
  28. X509_CRL *OSSL_STORE_INFO_get0_CRL(const OSSL_STORE_INFO *store_info);
  29. X509_CRL *OSSL_STORE_INFO_get1_CRL(const OSSL_STORE_INFO *store_info);
  30. const char *OSSL_STORE_INFO_type_string(int type);
  31. void OSSL_STORE_INFO_free(OSSL_STORE_INFO *store_info);
  32. OSSL_STORE_INFO *OSSL_STORE_INFO_new_NAME(char *name);
  33. int OSSL_STORE_INFO_set0_NAME_description(OSSL_STORE_INFO *info, char *desc);
  34. OSSL_STORE_INFO *OSSL_STORE_INFO_new_PARAMS(DSA *dsa_params);
  35. OSSL_STORE_INFO *OSSL_STORE_INFO_new_PKEY(EVP_PKEY *pkey);
  36. OSSL_STORE_INFO *OSSL_STORE_INFO_new_CERT(X509 *x509);
  37. OSSL_STORE_INFO *OSSL_STORE_INFO_new_CRL(X509_CRL *crl);
  38. =head1 DESCRIPTION
  39. These functions are primarily useful for applications to retrieve
  40. supported objects from B<OSSL_STORE_INFO> objects and for scheme specific
  41. loaders to create B<OSSL_STORE_INFO> holders.
  42. =head2 Types
  43. B<OSSL_STORE_INFO> is an opaque type that's just an intermediary holder for
  44. the objects that have been retrieved by OSSL_STORE_load() and similar
  45. functions.
  46. Supported OpenSSL type object can be extracted using one of
  47. STORE_INFO_get0_TYPE().
  48. The life time of this extracted object is as long as the life time of
  49. the B<OSSL_STORE_INFO> it was extracted from, so care should be taken not
  50. to free the latter too early.
  51. As an alternative, STORE_INFO_get1_TYPE() extracts a duplicate (or the
  52. same object with its reference count increased), which can be used
  53. after the containing B<OSSL_STORE_INFO> has been freed.
  54. The object returned by STORE_INFO_get1_TYPE() must be freed separately
  55. by the caller.
  56. See L</SUPPORTED OBJECTS> for more information on the types that are
  57. supported.
  58. =head2 Functions
  59. OSSL_STORE_INFO_get_type() takes a B<OSSL_STORE_INFO> and returns the STORE
  60. type number for the object inside.
  61. STORE_INFO_get_type_string() takes a STORE type number and returns a
  62. short string describing it.
  63. OSSL_STORE_INFO_get0_NAME(), OSSL_STORE_INFO_get0_NAME_description(),
  64. OSSL_STORE_INFO_get0_PARAMS(), OSSL_STORE_INFO_get0_PKEY(),
  65. OSSL_STORE_INFO_get0_CERT() and OSSL_STORE_INFO_get0_CRL() all take a
  66. B<OSSL_STORE_INFO> and return the held object of the appropriate OpenSSL
  67. type provided that's what's held.
  68. OSSL_STORE_INFO_get1_NAME(), OSSL_STORE_INFO_get1_NAME_description(),
  69. OSSL_STORE_INFO_get1_PARAMS(), OSSL_STORE_INFO_get1_PKEY(),
  70. OSSL_STORE_INFO_get1_CERT() and OSSL_STORE_INFO_get1_CRL() all take a
  71. B<OSSL_STORE_INFO> and return a duplicate of the held object of the
  72. appropriate OpenSSL type provided that's what's held.
  73. OSSL_STORE_INFO_free() frees a B<OSSL_STORE_INFO> and its contained type.
  74. OSSL_STORE_INFO_new_NAME() , OSSL_STORE_INFO_new_PARAMS(),
  75. OSSL_STORE_INFO_new_PKEY(), OSSL_STORE_INFO_new_CERT() and
  76. OSSL_STORE_INFO_new_CRL() create a B<OSSL_STORE_INFO>
  77. object to hold the given input object.
  78. Additionally, for B<OSSL_STORE_INFO_NAME>` objects,
  79. OSSL_STORE_INFO_set0_NAME_description() can be used to add an extra
  80. description.
  81. This description is meant to be human readable and should be used for
  82. information printout.
  83. =head1 SUPPORTED OBJECTS
  84. Currently supported object types are:
  85. =over 4
  86. =item OSSL_STORE_INFO_NAME
  87. A name is exactly that, a name.
  88. It's like a name in a directory, but formatted as a complete URI.
  89. For example, the path in URI C<file:/foo/bar/> could include a file
  90. named C<cookie.pem>, and in that case, the returned B<OSSL_STORE_INFO_NAME>
  91. object would have the URI C<file:/foo/bar/cookie.pem>, which can be
  92. used by the application to get the objects in that file.
  93. This can be applied to all schemes that can somehow support a listing
  94. of object URIs.
  95. For C<file:> URIs that are used without the explicit scheme, the
  96. returned name will be the path of each object, so if C</foo/bar> was
  97. given and that path has the file C<cookie.pem>, the name
  98. C</foo/bar/cookie.pem> will be returned.
  99. The returned URI is considered canonical and must be unique and permanent
  100. for the storage where the object (or collection of objects) resides.
  101. Each loader is responsible for ensuring that it only returns canonical
  102. URIs.
  103. However, it's possible that certain schemes allow an object (or collection
  104. thereof) to be reached with alternative URIs; just because one URI is
  105. canonical doesn't mean that other variants can't be used.
  106. At the discretion of the loader that was used to get these names, an
  107. extra description may be attached as well.
  108. =item OSSL_STORE_INFO_PARAMS
  109. Key parameters.
  110. =item OSSL_STORE_INFO_PKEY
  111. A private/public key of some sort.
  112. =item OSSL_STORE_INFO_CERT
  113. An X.509 certificate.
  114. =item OSSL_STORE_INFO_CRL
  115. A X.509 certificate revocation list.
  116. =back
  117. =head1 RETURN VALUES
  118. OSSL_STORE_INFO_get_type() returns the STORE type number of the given
  119. B<OSSL_STORE_INFO>.
  120. There is no error value.
  121. OSSL_STORE_INFO_get0_NAME(), OSSL_STORE_INFO_get0_NAME_description(),
  122. OSSL_STORE_INFO_get0_PARAMS(), OSSL_STORE_INFO_get0_PKEY(),
  123. OSSL_STORE_INFO_get0_CERT() and OSSL_STORE_INFO_get0_CRL() all return
  124. a pointer to the OpenSSL object on success, NULL otherwise.
  125. OSSL_STORE_INFO_get0_NAME(), OSSL_STORE_INFO_get0_NAME_description(),
  126. OSSL_STORE_INFO_get0_PARAMS(), OSSL_STORE_INFO_get0_PKEY(),
  127. OSSL_STORE_INFO_get0_CERT() and OSSL_STORE_INFO_get0_CRL() all return
  128. a pointer to a duplicate of the OpenSSL object on success, NULL otherwise.
  129. OSSL_STORE_INFO_type_string() returns a string on success, or B<NULL> on
  130. failure.
  131. OSSL_STORE_INFO_new_NAME(), OSSL_STORE_INFO_new_PARAMS(),
  132. OSSL_STORE_INFO_new_PKEY(), OSSL_STORE_INFO_new_CERT() and
  133. OSSL_STORE_INFO_new_CRL() return a B<OSSL_STORE_INFO>
  134. pointer on success, or B<NULL> on failure.
  135. OSSL_STORE_INFO_set0_NAME_description() returns 1 on success, or 0 on
  136. failure.
  137. =head1 SEE ALSO
  138. L<ossl_store(7)>, L<OSSL_STORE_open(3)>, L<OSSL_STORE_register_loader(3)>
  139. =head1 HISTORY
  140. OSSL_STORE_INFO(), OSSL_STORE_INFO_get_type(), OSSL_STORE_INFO_get0_NAME(),
  141. OSSL_STORE_INFO_get0_PARAMS(), OSSL_STORE_INFO_get0_PKEY(),
  142. OSSL_STORE_INFO_get0_CERT(), OSSL_STORE_INFO_get0_CRL(),
  143. OSSL_STORE_INFO_type_string(), OSSL_STORE_INFO_free(), OSSL_STORE_INFO_new_NAME(),
  144. OSSL_STORE_INFO_new_PARAMS(), OSSL_STORE_INFO_new_PKEY(),
  145. OSSL_STORE_INFO_new_CERT() and OSSL_STORE_INFO_new_CRL()
  146. were added to OpenSSL 1.1.1.
  147. =head1 COPYRIGHT
  148. Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved.
  149. Licensed under the OpenSSL license (the "License"). You may not use
  150. this file except in compliance with the License. You can obtain a copy
  151. in the file LICENSE in the source distribution or at
  152. L<https://www.openssl.org/source/license.html>.
  153. =cut