UI_UTIL_read_pw.pod 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. =pod
  2. =head1 NAME
  3. UI_UTIL_read_pw_string, UI_UTIL_read_pw,
  4. UI_UTIL_wrap_read_pem_callback - user interface utilities
  5. =head1 SYNOPSIS
  6. #include <openssl/ui.h>
  7. int UI_UTIL_read_pw_string(char *buf, int length, const char *prompt,
  8. int verify);
  9. int UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt,
  10. int verify);
  11. UI_METHOD *UI_UTIL_wrap_read_pem_callback(pem_password_cb *cb, int rwflag);
  12. =head1 DESCRIPTION
  13. UI_UTIL_read_pw_string() asks for a passphrase, using B<prompt> as a
  14. prompt, and stores it in B<buf>.
  15. The maximum allowed size is given with B<length>, including the
  16. terminating NUL byte.
  17. If B<verify> is non-zero, the password will be verified as well.
  18. UI_UTIL_read_pw() does the same as UI_UTIL_read_pw_string(), the
  19. difference is that you can give it an external buffer B<buff> for the
  20. verification passphrase.
  21. UI_UTIL_wrap_read_pem_callback() can be used to create a temporary
  22. B<UI_METHOD> that wraps a given PEM password callback B<cb>.
  23. B<rwflag> is used to specify if this method will be used for
  24. passphrase entry without (0) or with (1) verification.
  25. When not used any more, the returned method should be freed with
  26. UI_destroy_method().
  27. =head1 NOTES
  28. UI_UTIL_read_pw_string() and UI_UTIL_read_pw() use default
  29. B<UI_METHOD>.
  30. See L<UI_get_default_method(3)> and friends for more information.
  31. The result from the B<UI_METHOD> created by
  32. UI_UTIL_wrap_read_pem_callback() will generate password strings in the
  33. encoding that the given password callback generates.
  34. The default password prompting functions (apart from
  35. UI_UTIL_read_pw_string() and UI_UTIL_read_pw(), there is
  36. PEM_def_callback(), EVP_read_pw_string() and EVP_read_pw_string_min())
  37. all use the default B<UI_METHOD>.
  38. =head1 RETURN VALUES
  39. UI_UTIL_read_pw_string() and UI_UTIL_read_pw() return 0 on success or a negative
  40. value on error.
  41. UI_UTIL_wrap_read_pem_callback() returns a valid B<UI_METHOD> structure or NULL
  42. if an error occurred.
  43. =head1 SEE ALSO
  44. L<UI_get_default_method(3)>
  45. =head1 COPYRIGHT
  46. Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
  47. Licensed under the OpenSSL license (the "License"). You may not use
  48. this file except in compliance with the License. You can obtain a copy
  49. in the file LICENSE in the source distribution or at
  50. L<https://www.openssl.org/source/license.html>.
  51. =cut