pem_export.h
Go to the documentation of this file.
1 /**
2  * @file pem_export.h
3  * @brief PEM file export functions
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneCRYPTO Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.5.2
29  **/
30 
31 #ifndef _PEM_EXPORT_H
32 #define _PEM_EXPORT_H
33 
34 //Dependencies
35 #include "core/crypto.h"
36 #include "pkix/pem_common.h"
37 #include "ecc/ec.h"
38 
39 //C++ guard
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 //PEM related functions
45 error_t pemExportCertificate(const uint8_t *cert, size_t certLen,
46  char_t *output, size_t *written);
47 
48 error_t pemExportCrl(const uint8_t *crl, size_t crlLen,
49  char_t *output, size_t *written);
50 
51 error_t pemExportCsr(const uint8_t *csr, size_t csrLen,
52  char_t *output, size_t *written);
53 
54 error_t pemExportEcParameters(const EcCurve *curve, char_t *output,
55  size_t *written);
56 
57 //C++ guard
58 #ifdef __cplusplus
59 }
60 #endif
61 
62 #endif
error_t pemExportEcParameters(const EcCurve *curve, char_t *output, size_t *written)
Export EC domain parameters to PEM format.
Definition: pem_export.c:151
error_t pemExportCsr(const uint8_t *csr, size_t csrLen, char_t *output, size_t *written)
Export a certification signing request to PEM format.
Definition: pem_export.c:119
error_t pemExportCertificate(const uint8_t *cert, size_t certLen, char_t *output, size_t *written)
Export an X.509 certificate to PEM format.
Definition: pem_export.c:53
PEM common definitions.
error_t
Error codes.
Definition: error.h:43
General definitions for cryptographic algorithms.
char char_t
Definition: compiler_port.h:55
error_t pemExportCrl(const uint8_t *crl, size_t crlLen, char_t *output, size_t *written)
Export a certificate revocation list to PEM format.
Definition: pem_export.c:86
#define EcCurve
Definition: ec.h:346
ECC (Elliptic Curve Cryptography)