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