Noise-C
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
loader.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Southern Storm Software, Pty Ltd.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included
12  * in all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  * DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef NOISE_KEYS_LOADER_H
24 #define NOISE_KEYS_LOADER_H
25 
26 #include <noise/keys/certificate.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
33  (Noise_Certificate **cert, const char *filename);
35  (Noise_Certificate **cert, NoiseProtobuf *pbuf);
36 
38  (Noise_CertificateChain **chain, const char *filename);
40  (Noise_CertificateChain **chain, NoiseProtobuf *pbuf);
41 
43  (Noise_PrivateKey **key, const char *filename,
44  const void *passphrase, size_t passphrase_len);
46  (Noise_PrivateKey **key, NoiseProtobuf *pbuf,
47  const void *passphrase, size_t passphrase_len);
48 
50  (const Noise_Certificate *cert, const char *filename);
52  (const Noise_Certificate *cert, NoiseProtobuf *pbuf);
53 
55  (const Noise_CertificateChain *chain, const char *filename);
57  (const Noise_CertificateChain *chain, NoiseProtobuf *pbuf);
58 
60  (const Noise_PrivateKey *key, const char *filename,
61  const void *passphrase, size_t passphrase_len,
62  const char *protect_name);
64  (const Noise_PrivateKey *key, NoiseProtobuf *pbuf,
65  const void *passphrase, size_t passphrase_len,
66  const char *protect_name);
67 
68 #ifdef __cplusplus
69 };
70 #endif
71 
72 #endif
int noise_save_certificate_to_buffer(const Noise_Certificate *cert, NoiseProtobuf *pbuf)
Saves a certificate to a protobuf.
Definition: loader.c:655
int noise_load_certificate_chain_from_buffer(Noise_CertificateChain **chain, NoiseProtobuf *pbuf)
Loads a certificate chain from a protobuf.
Definition: loader.c:315
int noise_save_private_key_to_file(const Noise_PrivateKey *key, const char *filename, const void *passphrase, size_t passphrase_len, const char *protect_name)
Saves a private key in encrypted form to a file.
Definition: loader.c:727
int noise_load_private_key_from_file(Noise_PrivateKey **key, const char *filename, const void *passphrase, size_t passphrase_len)
Loads a private key from a file.
Definition: loader.c:376
int noise_load_certificate_from_file(Noise_Certificate **cert, const char *filename)
Loads a certificate from a file.
Definition: loader.c:179
int noise_load_certificate_from_buffer(Noise_Certificate **cert, NoiseProtobuf *pbuf)
Loads a certificate from a protobuf.
Definition: loader.c:214
int noise_save_certificate_chain_to_buffer(const Noise_CertificateChain *chain, NoiseProtobuf *pbuf)
Saves a certificate chain to a protobuf.
Definition: loader.c:697
int noise_save_private_key_to_buffer(const Noise_PrivateKey *key, NoiseProtobuf *pbuf, const void *passphrase, size_t passphrase_len, const char *protect_name)
Saves a private key in encrypted form to a protobuf.
Definition: loader.c:808
int noise_save_certificate_chain_to_file(const Noise_CertificateChain *chain, const char *filename)
Saves a certificate chain to a file.
Definition: loader.c:678
int noise_load_private_key_from_buffer(Noise_PrivateKey **key, NoiseProtobuf *pbuf, const void *passphrase, size_t passphrase_len)
Loads a private key from a protobuf.
Definition: loader.c:451
int noise_save_certificate_to_file(const Noise_Certificate *cert, const char *filename)
Saves a certificate to a file.
Definition: loader.c:637
int noise_load_certificate_chain_from_file(Noise_CertificateChain **chain, const char *filename)
Loads a certificate chain from a file.
Definition: loader.c:280