libssh
0.8.3
The SSH library
include
libssh
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
#ifdef HAVE_LIBGCRYPT
32
gcry_sexp_t dsa_pub;
33
gcry_sexp_t rsa_pub;
34
#elif HAVE_LIBCRYPTO
35
DSA *dsa_pub;
36
RSA *rsa_pub;
37
#elif HAVE_LIBMBEDCRYPTO
38
mbedtls_pk_context *rsa_pub;
39
void
*dsa_pub;
40
#endif
41
};
42
43
struct
ssh_private_key_struct
{
44
int
type;
45
#ifdef HAVE_LIBGCRYPT
46
gcry_sexp_t dsa_priv;
47
gcry_sexp_t rsa_priv;
48
#elif defined HAVE_LIBCRYPTO
49
DSA *dsa_priv;
50
RSA *rsa_priv;
51
#elif HAVE_LIBMBEDCRYPTO
52
mbedtls_pk_context *rsa_priv;
53
void
*dsa_priv;
54
#endif
55
};
56
57
const
char
*ssh_type_to_char(
int
type);
58
int
ssh_type_from_name(
const
char
*name);
59
60
ssh_public_key
publickey_from_string(
ssh_session
session,
ssh_string
pubkey_s);
61
62
#endif
/* KEYS_H_ */
ssh_session_struct
Definition:
session.h:102
ssh_public_key_struct
Definition:
keys.h:28
ssh_string_struct
Definition:
string.h:29
ssh_private_key_struct
Definition:
keys.h:43
Generated by
1.8.14