summaryrefslogtreecommitdiff
path: root/key.h
blob: d1bcf3b1bed7e3df49c2d29c15b6a2ae54138dfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef KEY_H
#define KEY_H

typedef struct Key Key;
enum types {
	KEY_RSA,
	KEY_DSA,
	KEY_EMPTY
};
struct Key {
	int	type;
	RSA	*rsa;
	DSA	*dsa;
};

Key	*key_new(int type);
void	key_free(Key *k);
int	key_equal(Key *a, Key *b);
char	*key_fingerprint(Key *k);
int	key_write(Key *key, FILE *f);
unsigned int
key_read(Key *key, char **cpp);

#endif