]> the.earth.li Git - onak.git/blob - key-store.h
0.6.3 release
[onak.git] / key-store.h
1 /*
2  * key-store.h - High level routines to load + save OpenPGP packets/keys
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the Free
6  * Software Foundation; version 2 of the License.
7  *
8  * This program is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11  * more details.
12  *
13  * You should have received a copy of the GNU General Public License along with
14  * this program.  If not, see <https://www.gnu.org/licenses/>.
15  */
16
17 #ifndef __KEY_STORE_H__
18 #define __KEY_STORE_H__
19
20 #include "build-config.h"
21 #include "keystructs.h"
22 #include "onak.h"
23
24 /**
25  *      onak_read_openpgp_file - Reads a set of OpenPGP packets from a file
26  *      @file: The file to open and read
27  *      @packets: The returned packet list
28  *
29  *      This function opens the supplied file and tries to parse it as a set
30  *      of OpenPGP packets. It will attempt to autodetect if the file is ASCII
31  *      armored, or binary packets, and adapt accordingly. The packets read are
32  *      returned in the packets parameter. It is the callers responsbility to
33  *      free the packet memory when it is no longe required, e.g. using
34  *      free_packet_list.
35  *
36  *      Returns a status code indicating any error.
37  */
38 onak_status_t onak_read_openpgp_file(const char *file,
39                 struct openpgp_packet_list **packets);
40
41 #endif /* __KEY_STORE_H__ */