2 * key-store.h - High level routines to load + save OpenPGP packets/keys
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.
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
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/>.
17 #ifndef __KEY_STORE_H__
18 #define __KEY_STORE_H__
20 #include "build-config.h"
21 #include "keystructs.h"
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
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
36 * Returns a status code indicating any error.
38 onak_status_t onak_read_openpgp_file(const char *file,
39 struct openpgp_packet_list **packets);
41 #endif /* __KEY_STORE_H__ */