PEM file export functions. More...
#include "core/crypto.h"
#include "pkix/pem_common.h"
#include "pkc/dh.h"
#include "pkc/rsa.h"
#include "pkc/dsa.h"
#include "ecc/ec.h"
#include "ecc/eddsa.h"
Go to the source code of this file.
Functions | |
error_t | pemExportCertificate (const uint8_t *cert, size_t certLen, char_t *output, size_t *written) |
Export an X.509 certificate to PEM format. More... | |
error_t | pemExportCrl (const uint8_t *crl, size_t crlLen, char_t *output, size_t *written) |
Export a certificate revocation list to PEM format. More... | |
error_t | pemExportCsr (const uint8_t *csr, size_t csrLen, char_t *output, size_t *written) |
Export a certification signing request to PEM format. More... | |
error_t | pemExportRsaPublicKey (const RsaPublicKey *publicKey, char_t *output, size_t *written) |
Export an RSA public key to PEM format. More... | |
error_t | pemExportRsaPrivateKey (const RsaPrivateKey *privateKey, char_t *output, size_t *written) |
Export an RSA private key to PEM format. More... | |
error_t | pemExportRsaPssPublicKey (const RsaPublicKey *publicKey, char_t *output, size_t *written) |
Export an RSA-PSS public key to PEM format. More... | |
error_t | pemExportRsaPssPrivateKey (const RsaPrivateKey *privateKey, char_t *output, size_t *written) |
Export an RSA-PSS private key to PEM format. More... | |
error_t | pemExportDsaPublicKey (const DsaPublicKey *publicKey, char_t *output, size_t *written) |
Export a DSA public key to PEM format. More... | |
error_t | pemExportDsaPrivateKey (const DsaPrivateKey *privateKey, char_t *output, size_t *written) |
Export a DSA private key to PEM format. More... | |
error_t | pemExportEcParameters (const EcCurveInfo *curveInfo, char_t *output, size_t *written) |
Export EC domain parameters to PEM format. More... | |
error_t | pemExportEcPublicKey (const EcCurveInfo *curveInfo, const EcPublicKey *publicKey, char_t *output, size_t *written) |
Export an EC public key to PEM format. More... | |
error_t | pemExportEcPrivateKey (const EcCurveInfo *curveInfo, const EcPrivateKey *privateKey, const EcPublicKey *publicKey, char_t *output, size_t *written) |
Export an EC private key to PEM format. More... | |
error_t | pemExportEddsaPublicKey (const EcCurveInfo *curveInfo, const EddsaPublicKey *publicKey, char_t *output, size_t *written) |
Export an EdDSA public key to PEM format. More... | |
error_t | pemExportEddsaPrivateKey (const EcCurveInfo *curveInfo, const EddsaPrivateKey *privateKey, char_t *output, size_t *written) |
Export an EdDSA private key to PEM format. More... | |
Detailed Description
PEM file export functions.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneCRYPTO Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file pem_export.h.
Function Documentation
◆ pemExportCertificate()
error_t pemExportCertificate | ( | const uint8_t * | cert, |
size_t | certLen, | ||
char_t * | output, | ||
size_t * | written | ||
) |
Export an X.509 certificate to PEM format.
- Parameters
-
[in] cert Pointer to the DER-encoded certificate [in] certLen Length of the DER-encoded certificate, in bytes [out] output Buffer where to store the PEM encoding [out] written Length of the resulting PEM encoding
- Returns
- Error code
Definition at line 57 of file pem_export.c.
◆ pemExportCrl()
Export a certificate revocation list to PEM format.
- Parameters
-
[in] crl Pointer to the DER-encoded CRL [in] crlLen Length of the DER-encoded CRL, in bytes [out] output Buffer where to store the PEM encoding [out] written Length of the resulting PEM encoding
- Returns
- Error code
Definition at line 90 of file pem_export.c.
◆ pemExportCsr()
Export a certification signing request to PEM format.
- Parameters
-
[in] csr Pointer to the DER-encoded CSR [in] csrLen Length of the DER-encoded CSR, in bytes [out] output Buffer where to store the PEM encoding [out] written Length of the resulting PEM encoding
- Returns
- Error code
Definition at line 123 of file pem_export.c.
◆ pemExportDsaPrivateKey()
error_t pemExportDsaPrivateKey | ( | const DsaPrivateKey * | privateKey, |
char_t * | output, | ||
size_t * | written | ||
) |
Export a DSA private key to PEM format.
- Parameters
-
[in] privateKey DSA private key [out] output Buffer where to store the PEM encoding [out] written Length of the resulting PEM encoding
- Returns
- Error code
Definition at line 522 of file pem_export.c.
◆ pemExportDsaPublicKey()
error_t pemExportDsaPublicKey | ( | const DsaPublicKey * | publicKey, |
char_t * | output, | ||
size_t * | written | ||
) |
Export a DSA public key to PEM format.
- Parameters
-
[in] publicKey DSA public key [out] output Buffer where to store the PEM encoding [out] written Length of the resulting PEM encoding
- Returns
- Error code
Definition at line 469 of file pem_export.c.
◆ pemExportEcParameters()
error_t pemExportEcParameters | ( | const EcCurveInfo * | curveInfo, |
char_t * | output, | ||
size_t * | written | ||
) |
Export EC domain parameters to PEM format.
- Parameters
-
[in] curveInfo Elliptic curve parameters [out] output Buffer where to store the PEM encoding [out] written Length of the resulting PEM encoding
- Returns
- Error code
Definition at line 627 of file pem_export.c.
◆ pemExportEcPrivateKey()
error_t pemExportEcPrivateKey | ( | const EcCurveInfo * | curveInfo, |
const EcPrivateKey * | privateKey, | ||
const EcPublicKey * | publicKey, | ||
char_t * | output, | ||
size_t * | written | ||
) |
Export an EC private key to PEM format.
- Parameters
-
[in] curveInfo Elliptic curve parameters [in] privateKey EC private key [in] publicKey EC public key (optional parameter) [out] output Buffer where to store the PEM encoding [out] written Length of the resulting PEM encoding
- Returns
- Error code
Definition at line 736 of file pem_export.c.
◆ pemExportEcPublicKey()
error_t pemExportEcPublicKey | ( | const EcCurveInfo * | curveInfo, |
const EcPublicKey * | publicKey, | ||
char_t * | output, | ||
size_t * | written | ||
) |
Export an EC public key to PEM format.
- Parameters
-
[in] curveInfo Elliptic curve parameters [in] publicKey EC public key [out] output Buffer where to store the PEM encoding [out] written Length of the resulting PEM encoding
- Returns
- Error code
Definition at line 679 of file pem_export.c.
◆ pemExportEddsaPrivateKey()
error_t pemExportEddsaPrivateKey | ( | const EcCurveInfo * | curveInfo, |
const EddsaPrivateKey * | privateKey, | ||
char_t * | output, | ||
size_t * | written | ||
) |
Export an EdDSA private key to PEM format.
- Parameters
-
[in] curveInfo Elliptic curve parameters [in] privateKey EdDSA private key [out] output Buffer where to store the PEM encoding [out] written Length of the resulting PEM encoding
- Returns
- Error code
Definition at line 898 of file pem_export.c.
◆ pemExportEddsaPublicKey()
error_t pemExportEddsaPublicKey | ( | const EcCurveInfo * | curveInfo, |
const EddsaPublicKey * | publicKey, | ||
char_t * | output, | ||
size_t * | written | ||
) |
Export an EdDSA public key to PEM format.
- Parameters
-
[in] curveInfo Elliptic curve parameters [in] publicKey EdDSA public key [out] output Buffer where to store the PEM encoding [out] written Length of the resulting PEM encoding
- Returns
- Error code
Definition at line 844 of file pem_export.c.
◆ pemExportRsaPrivateKey()
error_t pemExportRsaPrivateKey | ( | const RsaPrivateKey * | privateKey, |
char_t * | output, | ||
size_t * | written | ||
) |
Export an RSA private key to PEM format.
- Parameters
-
[in] privateKey RSA private key [out] output Buffer where to store the PEM encoding [out] written Length of the resulting PEM encoding
- Returns
- Error code
Definition at line 208 of file pem_export.c.
◆ pemExportRsaPssPrivateKey()
error_t pemExportRsaPssPrivateKey | ( | const RsaPrivateKey * | privateKey, |
char_t * | output, | ||
size_t * | written | ||
) |
Export an RSA-PSS private key to PEM format.
- Parameters
-
[in] privateKey RSA-PSS private key [out] output Buffer where to store the PEM encoding [out] written Length of the resulting PEM encoding
- Returns
- Error code
Definition at line 365 of file pem_export.c.
◆ pemExportRsaPssPublicKey()
error_t pemExportRsaPssPublicKey | ( | const RsaPublicKey * | publicKey, |
char_t * | output, | ||
size_t * | written | ||
) |
Export an RSA-PSS public key to PEM format.
- Parameters
-
[in] publicKey RSA-PSS public key [out] output Buffer where to store the PEM encoding [out] written Length of the resulting PEM encoding
- Returns
- Error code
Definition at line 312 of file pem_export.c.
◆ pemExportRsaPublicKey()
error_t pemExportRsaPublicKey | ( | const RsaPublicKey * | publicKey, |
char_t * | output, | ||
size_t * | written | ||
) |
Export an RSA public key to PEM format.
- Parameters
-
[in] publicKey RSA public key [out] output Buffer where to store the PEM encoding [out] written Length of the resulting PEM encoding
- Returns
- Error code
Definition at line 155 of file pem_export.c.