EVP_PKEY_CTX_set1_pbe_pass.pod 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. =pod
  2. =head1 NAME
  3. EVP_PKEY_CTX_set1_pbe_pass
  4. - generic KDF support functions
  5. =head1 SYNOPSIS
  6. #include <openssl/kdf.h>
  7. int EVP_PKEY_CTX_set1_pbe_pass(EVP_PKEY_CTX *pctx, unsigned char *pass,
  8. int passlen);
  9. =head1 DESCRIPTION
  10. These functions are generic support functions for all KDF algorithms.
  11. EVP_PKEY_CTX_set1_pbe_pass() sets the password to the B<passlen> first
  12. bytes from B<pass>.
  13. =begin comment
  14. We really should have a few more, such as EVP_PKEY_CTX_set1_kdf_salt,
  15. EVP_PKEY_CTX_set1_kdf_key (to be used by the algorithms that use a
  16. key, such as hkdf), EVP_PKEY_CTX_set1_kdf_md (same thing here).
  17. =end comment
  18. =head1 STRING CTRLS
  19. There is also support for string based control operations via
  20. L<EVP_PKEY_CTX_ctrl_str(3)>.
  21. The B<password> can be directly specified using the B<type> parameter
  22. "pass" or given in hex encoding using the "hexpass" parameter.
  23. =begin comment
  24. Just as for the function description, the strings "salt", "hexsalt",
  25. "key", "hexkey" and "md" should be generically specified, and
  26. supported by the algorithms that use them.
  27. =end comment
  28. =head1 RETURN VALUES
  29. All these functions return 1 for success and 0 or a negative value for failure.
  30. In particular a return value of -2 indicates the operation is not supported by
  31. the public key algorithm.
  32. =head1 SEE ALSO
  33. L<EVP_PKEY_CTX_new(3)>,
  34. L<EVP_PKEY_CTX_ctrl_str(3)>,
  35. L<EVP_PKEY_derive(3)>
  36. =head1 HISTORY
  37. EVP_PKEY_CTX_set1_pbe_pass() was converted from a macro to a function in
  38. OpenSSL 3.0.
  39. =head1 COPYRIGHT
  40. Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
  41. Licensed under the Apache License 2.0 (the "License"). You may not use
  42. this file except in compliance with the License. You can obtain a copy
  43. in the file LICENSE in the source distribution or at
  44. L<https://www.openssl.org/source/license.html>.
  45. =cut