diff options
Diffstat (limited to 'key.h')
-rw-r--r-- | key.h | 28 |
1 files changed, 25 insertions, 3 deletions
@@ -26,9 +26,10 @@ | |||
26 | 26 | ||
27 | typedef struct Key Key; | 27 | typedef struct Key Key; |
28 | enum types { | 28 | enum types { |
29 | KEY_RSA1, | ||
29 | KEY_RSA, | 30 | KEY_RSA, |
30 | KEY_DSA, | 31 | KEY_DSA, |
31 | KEY_EMPTY | 32 | KEY_UNSPEC |
32 | }; | 33 | }; |
33 | struct Key { | 34 | struct Key { |
34 | int type; | 35 | int type; |
@@ -37,12 +38,33 @@ struct Key { | |||
37 | }; | 38 | }; |
38 | 39 | ||
39 | Key *key_new(int type); | 40 | Key *key_new(int type); |
41 | Key *key_new_private(int type); | ||
40 | void key_free(Key *k); | 42 | void key_free(Key *k); |
41 | int key_equal(Key *a, Key *b); | 43 | int key_equal(Key *a, Key *b); |
42 | char *key_fingerprint(Key *k); | 44 | char *key_fingerprint(Key *k); |
43 | char *key_type(Key *k); | 45 | char *key_type(Key *k); |
44 | int key_write(Key *key, FILE *f); | 46 | int key_write(Key *key, FILE *f); |
45 | unsigned int key_read(Key *key, char **cpp); | 47 | int key_read(Key *key, char **cpp); |
46 | unsigned int key_size(Key *k); | 48 | u_int key_size(Key *k); |
49 | |||
50 | Key *key_generate(int type, unsigned int bits); | ||
51 | Key *key_from_private(Key *k); | ||
52 | int key_type_from_name(char *name); | ||
53 | |||
54 | Key *key_from_blob(char *blob, int blen); | ||
55 | int key_to_blob(Key *key, unsigned char **blobp, unsigned int *lenp); | ||
56 | char *key_ssh_name(Key *k); | ||
57 | |||
58 | int | ||
59 | key_sign( | ||
60 | Key *key, | ||
61 | unsigned char **sigp, int *lenp, | ||
62 | unsigned char *data, int datalen); | ||
63 | |||
64 | int | ||
65 | key_verify( | ||
66 | Key *key, | ||
67 | unsigned char *signature, int signaturelen, | ||
68 | unsigned char *data, int datalen); | ||
47 | 69 | ||
48 | #endif | 70 | #endif |