OSSL_DECODER.pod 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. =pod
  2. =head1 NAME
  3. OSSL_DECODER,
  4. OSSL_DECODER_fetch,
  5. OSSL_DECODER_up_ref,
  6. OSSL_DECODER_free,
  7. OSSL_DECODER_provider,
  8. OSSL_DECODER_properties,
  9. OSSL_DECODER_is_a,
  10. OSSL_DECODER_number,
  11. OSSL_DECODER_do_all_provided,
  12. OSSL_DECODER_names_do_all,
  13. OSSL_DECODER_gettable_params,
  14. OSSL_DECODER_get_params
  15. - Decoder method routines
  16. =head1 SYNOPSIS
  17. #include <openssl/decoder.h>
  18. typedef struct ossl_decoder_st OSSL_DECODER;
  19. OSSL_DECODER *OSSL_DECODER_fetch(OPENSSL_CTX *ctx, const char *name,
  20. const char *properties);
  21. int OSSL_DECODER_up_ref(OSSL_DECODER *decoder);
  22. void OSSL_DECODER_free(OSSL_DECODER *decoder);
  23. const OSSL_PROVIDER *OSSL_DECODER_provider(const OSSL_DECODER *decoder);
  24. const char *OSSL_DECODER_properties(const OSSL_DECODER *decoder);
  25. int OSSL_DECODER_is_a(const OSSL_DECODER *decoder, const char *name);
  26. int OSSL_DECODER_number(const OSSL_DECODER *decoder);
  27. void OSSL_DECODER_do_all_provided(OPENSSL_CTX *libctx,
  28. void (*fn)(OSSL_DECODER *decoder, void *arg),
  29. void *arg);
  30. void OSSL_DECODER_names_do_all(const OSSL_DECODER *decoder,
  31. void (*fn)(const char *name, void *data),
  32. void *data);
  33. const OSSL_PARAM *OSSL_DECODER_gettable_params(OSSL_DECODER *decoder);
  34. int OSSL_DECODER_get_params(OSSL_DECODER_CTX *ctx, const OSSL_PARAM params[]);
  35. =head1 DESCRIPTION
  36. B<OSSL_DECODER> is a method for decoders, which know how to
  37. decode encoded data into an object of some type that the rest
  38. of OpenSSL knows how to handle.
  39. OSSL_DECODER_fetch() looks for an algorithm within the provider that
  40. has been loaded into the B<OPENSSL_CTX> given by I<ctx>, having the
  41. name given by I<name> and the properties given by I<properties>.
  42. The I<name> determines what type of object the fetched decoder
  43. method is expected to be able to decode, and the properties are
  44. used to determine the expected output type.
  45. For known properties and the values they may have, please have a look
  46. in L<provider-encoder(7)/Names and properties>.
  47. OSSL_DECODER_up_ref() increments the reference count for the given
  48. I<decoder>.
  49. OSSL_DECODER_free() decrements the reference count for the given
  50. I<decoder>, and when the count reaches zero, frees it.
  51. OSSL_DECODER_provider() returns the provider of the given
  52. I<decoder>.
  53. OSSL_DECODER_properties() returns the property definition associated
  54. with the given I<decoder>.
  55. OSSL_DECODER_is_a() checks if I<decoder> is an implementation
  56. of an algorithm that's identifiable with I<name>.
  57. OSSL_DECODER_number() returns the internal dynamic number assigned
  58. to the given I<decoder>.
  59. OSSL_DECODER_names_do_all() traverses all names for the given
  60. I<decoder>, and calls I<fn> with each name and I<data>.
  61. OSSL_DECODER_do_all_provided() traverses all encoder
  62. implementations by all activated providers in the library context
  63. I<libctx>, and for each of the implementations, calls I<fn> with the
  64. implementation method and I<data> as arguments.
  65. OSSL_DECODER_gettable_params() returns an L<OSSL_PARAM(3)>
  66. array of parameter descriptors.
  67. OSSL_DECODER_get_params() attempts to get parameters specified
  68. with an L<OSSL_PARAM(3)> array I<params>. Parameters that the
  69. implementation doesn't recognise should be ignored.
  70. =head1 RETURN VALUES
  71. OSSL_DECODER_fetch() returns a pointer to an OSSL_DECODER object,
  72. or NULL on error.
  73. OSSL_DECODER_up_ref() returns 1 on success, or 0 on error.
  74. OSSL_DECODER_free() doesn't return any value.
  75. OSSL_DECODER_provider() returns a pointer to a provider object, or
  76. NULL on error.
  77. OSSL_DECODER_properties() returns a pointer to a property
  78. definition string, or NULL on error.
  79. OSSL_DECODER_is_a() returns 1 if I<decoder> was identifiable,
  80. otherwise 0.
  81. OSSL_DECODER_number() returns an integer.
  82. =head1 NOTES
  83. OSSL_DECODER_fetch() may be called implicitly by other fetching
  84. functions, using the same library context and properties.
  85. Any other API that uses keys will typically do this.
  86. =begin comment TODO(3.0) Add examples!
  87. =head1 EXAMPLES
  88. Text, because pod2xxx doesn't like empty sections
  89. =end comment
  90. =head1 SEE ALSO
  91. L<provider(7)>, L<OSSL_DECODER_CTX(3)>, L<OSSL_DECODER_from_bio(3)>,
  92. L<OSSL_DECODER_CTX_new_by_EVP_PKEY(3)>, L<OPENSSL_CTX(3)>
  93. =head1 HISTORY
  94. The functions described here were added in OpenSSL 3.0.
  95. =head1 COPYRIGHT
  96. Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
  97. Licensed under the Apache License 2.0 (the "License"). You may not use
  98. this file except in compliance with the License. You can obtain a copy
  99. in the file LICENSE in the source distribution or at
  100. L<https://www.openssl.org/source/license.html>.
  101. =cut