OSSL_SERIALIZER.pod 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. =pod
  2. =head1 NAME
  3. OSSL_SERIALIZER,
  4. OSSL_SERIALIZER_fetch,
  5. OSSL_SERIALIZER_up_ref,
  6. OSSL_SERIALIZER_free,
  7. OSSL_SERIALIZER_provider,
  8. OSSL_SERIALIZER_properties,
  9. OSSL_SERIALIZER_is_a,
  10. OSSL_SERIALIZER_number,
  11. OSSL_SERIALIZER_do_all_provided,
  12. OSSL_SERIALIZER_names_do_all
  13. - Serializer method routines
  14. =head1 SYNOPSIS
  15. #include <openssl/serializer.h>
  16. typedef struct ossl_serializer_st OSSL_SERIALIZER;
  17. OSSL_SERIALIZER *OSSL_SERIALIZER_fetch(OPENSSL_CTX *ctx, const char *name,
  18. const char *properties);
  19. int OSSL_SERIALIZER_up_ref(OSSL_SERIALIZER *serializer);
  20. void OSSL_SERIALIZER_free(OSSL_SERIALIZER *serializer);
  21. const OSSL_PROVIDER *OSSL_SERIALIZER_provider(const OSSL_SERIALIZER
  22. *serializer);
  23. const char *OSSL_SERIALIZER_properties(const OSSL_SERIALIZER *ser);
  24. int OSSL_SERIALIZER_is_a(const OSSL_SERIALIZER *serializer,
  25. const char *name);
  26. int OSSL_SERIALIZER_number(const OSSL_SERIALIZER *serializer);
  27. void OSSL_SERIALIZER_do_all_provided(OPENSSL_CTX *libctx,
  28. void (*fn)(OSSL_SERIALIZER *serializer,
  29. void *arg),
  30. void *arg);
  31. void OSSL_SERIALIZER_names_do_all(const OSSL_SERIALIZER *serializer,
  32. void (*fn)(const char *name, void *data),
  33. void *data);
  34. =head1 DESCRIPTION
  35. =for comment Future development should also talk about deserialization
  36. B<OSSL_SERIALIZER> is a method for serializers, which know how to
  37. serialize an object of some kind to a serialized form, such as PEM,
  38. DER, or even human readable text.
  39. OSSL_SERIALIZER_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 serializer
  43. method is expected to be able to serialize, 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-serializer(7)/Names and properties>.
  47. OSSL_SERIALIZER_up_ref() increments the reference count for the given
  48. I<serializer>.
  49. OSSL_SERIALIZER_free() decrements the reference count for the given
  50. I<serializer>, and when the count reaches zero, frees it.
  51. OSSL_SERIALIZER_provider() returns the provider of the given
  52. I<serializer>.
  53. OSSL_SERIALIZER_provider() returns the property definition associated
  54. with the given I<serializer>.
  55. OSSL_SERIALIZER_is_a() checks if I<serializer> is an implementation of an
  56. algorithm that's identifiable with I<name>.
  57. OSSL_SERIALIZER_number() returns the internal dynamic number assigned to
  58. the given I<serializer>.
  59. OSSL_SERIALIZER_names_do_all() traverses all names for the given
  60. I<serializer>, and calls I<fn> with each name and I<data>.
  61. OSSL_SERIALIZER_do_all_provided() traverses all serializer
  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. =head1 NOTES
  66. OSSL_SERIALIZER_fetch() may be called implicitly by other fetching
  67. functions, using the same library context and properties.
  68. Any other API that uses keys will typically do this.
  69. =head1 RETURN VALUES
  70. OSSL_SERIALIZER_fetch() returns a pointer to the key management
  71. implementation represented by an OSSL_SERIALIZER object, or NULL on
  72. error.
  73. OSSL_SERIALIZER_up_ref() returns 1 on success, or 0 on error.
  74. OSSL_SERIALIZER_free() doesn't return any value.
  75. OSSL_SERIALIZER_provider() returns a pointer to a provider object, or
  76. NULL on error.
  77. OSSL_SERIALIZER_properties() returns a pointer to a property
  78. definition string, or NULL on error.
  79. OSSL_SERIALIZER_is_a() returns 1 of I<serializer> was identifiable,
  80. otherwise 0.
  81. OSSL_SERIALIZER_number() returns an integer.
  82. =head1 SEE ALSO
  83. L<provider(7)>, L<OSSL_SERIALIZER_CTX(3)>, L<OSSL_SERIALIZER_to_bio(3)>,
  84. L<OSSL_SERIALIZER_CTX_new_by_EVP_PKEY(3)>, L<OPENSSL_CTX(3)>
  85. =head1 HISTORY
  86. The functions described here were added in OpenSSL 3.0.
  87. =head1 COPYRIGHT
  88. Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
  89. Licensed under the Apache License 2.0 (the "License"). You may not use
  90. this file except in compliance with the License. You can obtain a copy
  91. in the file LICENSE in the source distribution or at
  92. L<https://www.openssl.org/source/license.html>.
  93. =cut