spki_commands.h 2.68 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* spki_commands.h
 *
 * $Id$ */

/* lsh, an implementation of the ssh protocol
 *
 * Copyright (C) 1999 Niels Mller
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef LSH_SPKI_COMMANDS_H_INCLUDED
#define LSH_SPKI_COMMANDS_H_INCLUDED

#include "command.h"
28
#include "interact.h"
29
30
#include "spki.h"

31
32
33
34
35
36
37
38
39
40
41
extern struct command_simple spki_signer2verifier;
#define SIGNER2VERIFIER (&spki_signer2verifier.super.super)

extern struct command_simple spki_verifier2public;
#define VERIFIER2PUBLIC (&spki_verifier2public.super.super)

extern struct command_simple spki_sexp2signer_command;
#define SEXP2SIGNER (&spki_sexp2signer_command.super.super)

extern struct command_simple spki_sexp2keypair_command;
#define SEXP2KEYPAIR (&spki_sexp2keypair_command.super.super)
42

43
extern struct command_simple spki_make_context_command;
44
45
#define SPKI_MAKE_CONTEXT (&spki_make_context_command.super.super)

46
extern struct command_simple spki_read_acls_command;
47
48
#define SPKI_READ_ACLS (&spki_read_acls_command.super.super.super)

49
extern struct command_simple spki_read_hostkeys_command;
50
51
#define SPKI_READ_HOSTKEYS (&spki_read_hostkeys_command.super.super)

52
#if 0
53
extern struct command_simple spki_read_userkeys_command;
54
#define SPKI_READ_USERKEYS (&spki_read_userkeys_command.super.super)
55
#endif
56

57
58
59
60
61
62
63
64
65
struct command *
make_spki_hash(int name, struct hash_algorithm *algorithm);

struct command *
make_spki_parse_key(struct alist *algorithms);

struct command *
make_spki_read_acls(struct alist *algorithms);

66
struct command *
67
68
69
make_spki_read_userkeys(struct alist *algorithms,
			struct interact *tty);
			
70

71
72
73
74
75
76
/* Encryption of private data. */
struct command *
make_pkcs5_encrypt(struct randomness *r,
		   struct lsh_string *label,
		   UINT32 prf_name,
		   struct mac_algorithm *prf,
77
		   int crypto_name,
78
79
80
81
82
		   struct crypto_algorithm *crypto,
		   UINT32 salt_length,
		   struct lsh_string *password,
		   UINT32 iterations);

83
84
85
86
87
struct command *
make_pkcs5_decrypt(struct alist *mac_algorithms,
		   struct alist *crypto_algorithms,
		   struct interact *tty);

88
#endif /* LSH_SPKI_COMMANDS_H_INCLUDED */