key-type.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* Copyright (C) 2013 Artyom V. Poptsov <poptsov.artyom@gmail.com>
  2. *
  3. * This file is part of Guile-SSH
  4. *
  5. * Guile-SSH is free software: you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation, either version 3 of the
  8. * License, or (at your option) any later version.
  9. *
  10. * Guile-SSH is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with Guile-SSH. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef __KEY_TYPE_H__
  19. #define __KEY_TYPE_H__
  20. #include <libguile.h>
  21. #include <libssh/libssh.h>
  22. #include "common.h"
  23. extern scm_t_bits key_tag;
  24. /* Smob data. */
  25. struct key_data {
  26. /* Store the parent object to prevent it from premature GC'ing. */
  27. SCM parent;
  28. ssh_key ssh_key;
  29. };
  30. /* Procedures */
  31. extern SCM guile_ssh_make_keypair (SCM arg1, SCM arg2);
  32. extern SCM guile_ssh_is_key_p (SCM arg1);
  33. extern SCM guile_ssh_is_public_key_p (SCM arg1);
  34. extern SCM guile_ssh_is_private_key_p (SCM arg1);
  35. extern SCM guile_ssh_key_get_type (SCM arg1);
  36. extern void init_key_type (void);
  37. /* Helper procedures */
  38. extern SCM _scm_from_ssh_key (ssh_key key, SCM x);
  39. extern struct key_data *_scm_to_key_data (SCM x);
  40. extern int _private_key_p (struct key_data *key);
  41. extern int _public_key_p (struct key_data *key);
  42. extern SCM _ssh_key_type_to_scm (int arg1);
  43. extern const struct symbol_mapping *_scm_to_ssh_key_type (SCM arg1);
  44. #endif /* ifndef __KEY_TYPE_H__ */