system-keys.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (C) 2014 Red Hat, Inc.
  3. *
  4. * Author: Nikos Mavrogiannopoulos
  5. *
  6. * This file is part of GnuTLS.
  7. *
  8. * The GnuTLS is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public License
  10. * as published by the Free Software Foundation; either version 2.1 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>
  20. *
  21. */
  22. #ifndef __GNUTLS_SYSTEM_KEYS_H
  23. #define __GNUTLS_SYSTEM_KEYS_H
  24. #include <gnutls/gnutls.h>
  25. #include <gnutls/x509.h>
  26. /* This API allows to access user key and certificate pairs that are
  27. * available in the current system. If any passwords are required,
  28. * they will be requested through the pin callbacks.
  29. */
  30. /* *INDENT-OFF* */
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. /* *INDENT-ON* */
  35. struct system_key_iter_st;
  36. typedef struct system_key_iter_st *gnutls_system_key_iter_t;
  37. void gnutls_system_key_iter_deinit(gnutls_system_key_iter_t iter);
  38. int
  39. gnutls_system_key_iter_get_info(gnutls_system_key_iter_t *iter,
  40. unsigned cert_type /* gnutls_certificate_type_t */,
  41. char **cert_url,
  42. char **key_url,
  43. char **label,
  44. gnutls_datum_t *der,
  45. unsigned int flags);
  46. int gnutls_system_key_delete(const char *cert_url, const char *key_url);
  47. int gnutls_system_key_add_x509(gnutls_x509_crt_t crt, gnutls_x509_privkey_t privkey,
  48. const char *label, char **cert_url, char **key_url);
  49. /* *INDENT-OFF* */
  50. #ifdef __cplusplus
  51. }
  52. #endif
  53. /* *INDENT-ON* */
  54. #endif