Annotation of src/usr.bin/ssh/authfile.h, Revision 1.2
1.1 markus 1: #ifndef AUTHFILE_H
2: #define AUTHFILE_H
3:
4: /*
5: * Saves the authentication (private) key in a file, encrypting it with
6: * passphrase.
7: * For RSA keys: The identification of the file (lowest 64 bits of n)
8: * will precede the key to provide identification of the key without
9: * needing a passphrase.
10: */
11: int
12: save_private_key(const char *filename, const char *passphrase,
13: Key * private_key, const char *comment);
14:
15: /*
16: * Loads the public part of the key file (public key and comment). Returns 0
17: * if an error occurred; zero if the public key was successfully read. The
18: * comment of the key is returned in comment_return if it is non-NULL; the
19: * caller must free the value with xfree.
20: */
1.2 ! markus 21: int load_public_key(const char *filename, Key * pub, char **comment_return);
! 22: int try_load_public_key(const char *filename, Key * pub, char **comment_return);
1.1 markus 23:
24: /*
25: * Loads the private key from the file. Returns 0 if an error is encountered
26: * (file does not exist or is not readable, or passphrase is bad). This
27: * initializes the private key. The comment of the key is returned in
28: * comment_return if it is non-NULL; the caller must free the value with
29: * xfree.
30: */
31: int
32: load_private_key(const char *filename, const char *passphrase,
33: Key * private_key, char **comment_return);
34:
35: #endif