libssh 0.11.1 The SSH library

Loading...
Searching...
No Matches
keys.h
1/*
2 * This file is part of the SSH Library
3 *
4 * Copyright (c) 2009 by Aris Adamantiadis
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#ifndef KEYS_H_
22#define KEYS_H_
23
24#include "config.h"
25#include "libssh/libssh.h"
26#include "libssh/wrapper.h"
27
28 struct ssh_public_key_struct {
29 int type;
30 const char *type_c; /* Don't free it ! it is static */
31#if defined(HAVE_LIBGCRYPT)
32 gcry_sexp_t rsa_pub;
33#elif defined(HAVE_LIBCRYPTO)
34 EVP_PKEY *key_pub;
35#elif defined(HAVE_LIBMBEDCRYPTO)
36 mbedtls_pk_context *rsa_pub;
37#endif
38};
39
40 struct ssh_private_key_struct {
41 int type;
42#if defined(HAVE_LIBGCRYPT)
43 gcry_sexp_t rsa_priv;
44#elif defined(HAVE_LIBCRYPTO)
45 EVP_PKEY *key_priv;
46#elif defined(HAVE_LIBMBEDCRYPTO)
47 mbedtls_pk_context *rsa_priv;
48#endif
49};
50
51#ifdef __cplusplus
52 extern "C" {
53#endif
54
55 const char *ssh_type_to_char(int type);
56 int ssh_type_from_name(const char *name);
57
58ssh_public_key publickey_from_string(ssh_session session, ssh_string pubkey_s);
59
60#ifdef __cplusplus
61}
62#endif
63
64#endif /* KEYS_H_ */