OSSL_PARAM_dup.pod 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. =pod
  2. =head1 NAME
  3. OSSL_PARAM_dup, OSSL_PARAM_merge, OSSL_PARAM_free
  4. - OSSL_PARAM array copy functions
  5. =head1 SYNOPSIS
  6. #include <openssl/params.h>
  7. OSSL_PARAM *OSSL_PARAM_dup(const OSSL_PARAM *params);
  8. OSSL_PARAM *OSSL_PARAM_merge(const OSSL_PARAM *params, const OSSL_PARAM *params1);
  9. void OSSL_PARAM_free(OSSL_PARAM *params);
  10. =head1 DESCRIPTION
  11. Algorithm parameters can be exported/imported from/to providers using arrays of
  12. L<OSSL_PARAM(3)>. The following utility functions allow the parameters to be
  13. duplicated and merged with other L<OSSL_PARAM(3)> to assist in this process.
  14. OSSL_PARAM_dup() duplicates the parameter array I<params>. This function does a
  15. deep copy of the data.
  16. OSSL_PARAM_merge() merges the parameter arrays I<params> and I<params1> into a
  17. new parameter array. If I<params> and I<params1> contain values with the same
  18. 'key' then the value from I<params1> will replace the I<param> value. This
  19. function does a shallow copy of the parameters. Either I<params> or I<params1>
  20. may be NULL. The behaviour of the merge is unpredictable if I<params> and
  21. I<params1> contain the same key, and there are multiple entries within either
  22. array that have the same key.
  23. OSSL_PARAM_free() frees the parameter array I<params> that was created using
  24. OSSL_PARAM_dup(), OSSL_PARAM_merge() or OSSL_PARAM_BLD_to_param().
  25. If the argument to OSSL_PARAM_free() is NULL, nothing is done.
  26. =head1 RETURN VALUES
  27. The functions OSSL_PARAM_dup() and OSSL_PARAM_merge() return a newly allocated
  28. L<OSSL_PARAM(3)> array, or NULL if there was an error. If both parameters are NULL
  29. then NULL is returned.
  30. =head1 SEE ALSO
  31. L<OSSL_PARAM(3)>, L<OSSL_PARAM_BLD(3)>
  32. =head1 HISTORY
  33. The functions were added in OpenSSL 3.0.
  34. =head1 COPYRIGHT
  35. Copyright 2021-2024 The OpenSSL Project Authors. All Rights Reserved.
  36. Licensed under the Apache License 2.0 (the "License"). You may not use
  37. this file except in compliance with the License. You can obtain a copy
  38. in the file LICENSE in the source distribution or at
  39. L<https://www.openssl.org/source/license.html>.
  40. =cut