cmd_creds.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (C) 2013 Martin Willi
  3. * Copyright (C) 2013 revosec AG
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License as published by the
  7. * Free Software Foundation; either version 2 of the License, or (at your
  8. * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  12. * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  13. * for more details.
  14. */
  15. /**
  16. * @defgroup cmd_creds cmd_creds
  17. * @{ @ingroup cmd
  18. */
  19. #ifndef CMD_CREDS_H_
  20. #define CMD_CREDS_H_
  21. #include <library.h>
  22. #include "cmd_options.h"
  23. typedef struct cmd_creds_t cmd_creds_t;
  24. /**
  25. * Credential backend providing certificates, private keys and shared secrets.
  26. */
  27. struct cmd_creds_t {
  28. /**
  29. * Handle a command line options related to credentials.
  30. *
  31. * @param opt option to handle
  32. * @param arg option argument
  33. * @return TRUE if option handled
  34. */
  35. bool (*handle)(cmd_creds_t *this, cmd_option_type_t opt, char *arg);
  36. /**
  37. * Destroy a cmd_creds_t.
  38. */
  39. void (*destroy)(cmd_creds_t *this);
  40. };
  41. /**
  42. * Create a cmd_creds instance.
  43. */
  44. cmd_creds_t *cmd_creds_create();
  45. #endif /** CMD_CREDS_H_ @}*/