]> asedeno.scripts.mit.edu Git - pssh.git/blob - data/publickeys.h
Greg Parker's 2005-06-23 release.
[pssh.git] / data / publickeys.h
1 /**********
2  * Copyright (c) 2004 Greg Parker.  All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY GREG PARKER ``AS IS'' AND ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  **********/
24
25 #ifndef PUBLICKEYS_H
26 #define PUBLICKEYS_H
27
28 #include "includes.h"
29 #include "queue.h"
30 #include "data/recordlist.h"
31 #include "ssh/openssh/key.h"
32
33 Boolean PublicKeysInit(void) PUBLICKEYS_SEGMENT;
34 void PublicKeysFree(void) PUBLICKEYS_SEGMENT;
35 void PublicKeysUpdate(void) PUBLICKEYS_SEGMENT;
36 Boolean PublicKeysHandleEvent(EventPtr event) PUBLICKEYS_SEGMENT;
37
38 UInt16 PublicKeysSelectedIndex(void) PUBLICKEYS_SEGMENT;
39 void PublicKeysDeleteSelectedRecord(void) PUBLICKEYS_SEGMENT;
40 MemHandle PublicKeysQuerySelectedRecord(Boolean *encrypted, char **comment, uint8_t **pubkey, uint16_t *pubkeylen, uint8_t **privkey, uint16_t *privkeylen) PUBLICKEYS_SEGMENT;
41 MemHandle PublicKeysQueryIndexedRecord(UInt16 index, Boolean *encrypted, char **comment, uint8_t **pubkey, uint16_t *pubkeylen, uint8_t **privkey, uint16_t *privkeylen) PUBLICKEYS_SEGMENT;
42
43 Key *PublicKeyForRecord(MemPtr recordP) PUBLICKEYS_SEGMENT;
44 Key *PrivateKeyForRecord(MemPtr recordP, char *passphrase) PUBLICKEYS_SEGMENT;
45 char *NameForPublicKey(MemHandle recordH) PUBLICKEYS_SEGMENT;
46 queue_t *PhraselessPublicKeys(void) PUBLICKEYS_SEGMENT;
47 queue_t *PhrasefulPublicKeys(void) PUBLICKEYS_SEGMENT;
48
49 Boolean SaveImportedPublicKey(Boolean encrypted, 
50                               char *comment, uint16_t commentlen,
51                               Key *pubkey, 
52                               char *privkey, uint16_t privkeylen)
53      PUBLICKEYS_SEGMENT;
54 Boolean WritePublicKeyRecord(Boolean encrypted, 
55                              char *comment, 
56                              char *pubkey, uint16_t pubkeylen, 
57                              char *privkey, uint16_t privkeylen)
58      PUBLICKEYS_SEGMENT;
59
60 #endif