PEM file import functions. More...
#include "core/crypto.h"
#include "pkix/pem_common.h"
#include "pkix/x509_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 | pemImportCertificate (const char_t *input, size_t inputLen, uint8_t *output, size_t *outputLen, size_t *consumed) |
Decode a PEM file containing a certificate. More... | |
error_t | pemImportCrl (const char_t *input, size_t inputLen, uint8_t *output, size_t *outputLen, size_t *consumed) |
Decode a PEM file containing a certificate revocation list. More... | |
error_t | pemImportCsr (const char_t *input, size_t inputLen, uint8_t *output, size_t *outputLen) |
Decode a PEM file containing a certification signing request. More... | |
error_t | pemImportDhParameters (const char_t *input, size_t length, DhParameters *params) |
Decode a PEM file containing Diffie-Hellman parameters. More... | |
error_t | pemImportRsaPublicKey (const char_t *input, size_t length, RsaPublicKey *publicKey) |
Decode a PEM file containing an RSA public key. More... | |
error_t | pemImportRsaPrivateKey (const char_t *input, size_t length, const char_t *password, RsaPrivateKey *privateKey) |
Decode a PEM file containing an RSA private key. More... | |
error_t | pemImportDsaPublicKey (const char_t *input, size_t length, DsaPublicKey *publicKey) |
Decode a PEM file containing a DSA public key. More... | |
error_t | pemImportDsaPrivateKey (const char_t *input, size_t length, const char_t *password, DsaPrivateKey *privateKey) |
Decode a PEM file containing a DSA private key. More... | |
error_t | pemImportEcParameters (const char_t *input, size_t length, EcDomainParameters *params) |
Decode a PEM file containing EC domain parameters. More... | |
error_t | pemImportEcPublicKey (const char_t *input, size_t length, EcPublicKey *publicKey) |
Decode a PEM file containing an EC public key. More... | |
error_t | pemImportEcPrivateKey (const char_t *input, size_t length, const char_t *password, EcPrivateKey *privateKey) |
Decode a PEM file containing an EC private key. More... | |
error_t | pemImportEddsaPublicKey (const char_t *input, size_t length, EddsaPublicKey *publicKey) |
Decode a PEM file containing a EdDSA public key. More... | |
error_t | pemImportEddsaPrivateKey (const char_t *input, size_t length, const char_t *password, EddsaPrivateKey *privateKey) |
Decode a PEM file containing a EdDSA private key. More... | |
error_t | pemGetPublicKeyType (const char_t *input, size_t length, X509KeyType *keyType) |
Retrieve the type of a PEM-encoded public key. More... | |
error_t | pemGetPrivateKeyType (const char_t *input, size_t length, X509KeyType *keyType) |
Retrieve the type of a PEM-encoded private key. More... | |
Detailed Description
PEM file import 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_import.h.
Function Documentation
◆ pemGetPrivateKeyType()
error_t pemGetPrivateKeyType | ( | const char_t * | input, |
size_t | length, | ||
X509KeyType * | keyType | ||
) |
Retrieve the type of a PEM-encoded private key.
- Parameters
-
[in] input Pointer to the PEM encoding [in] length Length of the PEM encoding [out] keyType Private key type
- Returns
- Error code
Definition at line 1707 of file pem_import.c.
◆ pemGetPublicKeyType()
error_t pemGetPublicKeyType | ( | const char_t * | input, |
size_t | length, | ||
X509KeyType * | keyType | ||
) |
Retrieve the type of a PEM-encoded public key.
- Parameters
-
[in] input Pointer to the PEM encoding [in] length Length of the PEM encoding [out] keyType Public key type
- Returns
- Error code
Definition at line 1598 of file pem_import.c.
◆ pemImportCertificate()
error_t pemImportCertificate | ( | const char_t * | input, |
size_t | inputLen, | ||
uint8_t * | output, | ||
size_t * | outputLen, | ||
size_t * | consumed | ||
) |
Decode a PEM file containing a certificate.
- Parameters
-
[in] input Pointer to the PEM encoding [in] inputLen Length of the PEM structure [out] output Pointer to the DER-encoded certificate [out] outputLen Length of the DER-encoded certificate, in bytes [out] consumed Total number of characters that have been consumed (optional parameter)
- Returns
- Error code
Definition at line 61 of file pem_import.c.
◆ pemImportCrl()
error_t pemImportCrl | ( | const char_t * | input, |
size_t | inputLen, | ||
uint8_t * | output, | ||
size_t * | outputLen, | ||
size_t * | consumed | ||
) |
Decode a PEM file containing a certificate revocation list.
- Parameters
-
[in] input Pointer to the PEM encoding [in] inputLen Length of the PEM structure [out] output Pointer to the DER-encoded CRL [out] outputLen Length of the DER-encoded CRL, in bytes [out] consumed Total number of characters that have been consumed (optional parameter)
- Returns
- Error code
Definition at line 92 of file pem_import.c.
◆ pemImportCsr()
error_t pemImportCsr | ( | const char_t * | input, |
size_t | inputLen, | ||
uint8_t * | output, | ||
size_t * | outputLen | ||
) |
Decode a PEM file containing a certification signing request.
- Parameters
-
[in] input Pointer to the PEM encoding [in] inputLen Length of the PEM structure [out] output Pointer to the DER-encoded CSR [out] outputLen Length of the DER-encoded CSR, in bytes
- Returns
- Error code
Definition at line 121 of file pem_import.c.
◆ pemImportDhParameters()
error_t pemImportDhParameters | ( | const char_t * | input, |
size_t | length, | ||
DhParameters * | params | ||
) |
Decode a PEM file containing Diffie-Hellman parameters.
- Parameters
-
[in] input Pointer to the PEM encoding [in] length Length of the PEM encoding [out] params Diffie-Hellman parameters resulting from the parsing process
- Returns
- Error code
Definition at line 149 of file pem_import.c.
◆ pemImportDsaPrivateKey()
error_t pemImportDsaPrivateKey | ( | const char_t * | input, |
size_t | length, | ||
const char_t * | password, | ||
DsaPrivateKey * | privateKey | ||
) |
Decode a PEM file containing a DSA private key.
- Parameters
-
[in] input Pointer to the PEM encoding [in] length Length of the PEM encoding [in] password NULL-terminated string containing the password. This parameter is required if the private key is encrypted [out] privateKey DSA private key resulting from the parsing process
- Returns
- Error code
Definition at line 676 of file pem_import.c.
◆ pemImportDsaPublicKey()
error_t pemImportDsaPublicKey | ( | const char_t * | input, |
size_t | length, | ||
DsaPublicKey * | publicKey | ||
) |
Decode a PEM file containing a DSA public key.
- Parameters
-
[in] input Pointer to the PEM encoding [in] length Length of the PEM encoding [out] publicKey DSA public key resulting from the parsing process
- Returns
- Error code
Definition at line 594 of file pem_import.c.
◆ pemImportEcParameters()
error_t pemImportEcParameters | ( | const char_t * | input, |
size_t | length, | ||
EcDomainParameters * | params | ||
) |
Decode a PEM file containing EC domain parameters.
- Parameters
-
[in] input Pointer to the PEM encoding [in] length Length of the PEM encoding [out] params EC domain parameters
- Returns
- Error code
Definition at line 881 of file pem_import.c.
◆ pemImportEcPrivateKey()
error_t pemImportEcPrivateKey | ( | const char_t * | input, |
size_t | length, | ||
const char_t * | password, | ||
EcPrivateKey * | privateKey | ||
) |
Decode a PEM file containing an EC private key.
- Parameters
-
[in] input Pointer to the PEM encoding [in] length Length of the PEM encoding [in] password NULL-terminated string containing the password. This parameter is required if the private key is encrypted [out] privateKey EC private key resulting from the parsing process
- Returns
- Error code
Definition at line 1163 of file pem_import.c.
◆ pemImportEcPublicKey()
error_t pemImportEcPublicKey | ( | const char_t * | input, |
size_t | length, | ||
EcPublicKey * | publicKey | ||
) |
Decode a PEM file containing an EC public key.
- Parameters
-
[in] input Pointer to the PEM encoding [in] length Length of the PEM encoding [out] publicKey EC public key resulting from the parsing process
- Returns
- Error code
Definition at line 1081 of file pem_import.c.
◆ pemImportEddsaPrivateKey()
error_t pemImportEddsaPrivateKey | ( | const char_t * | input, |
size_t | length, | ||
const char_t * | password, | ||
EddsaPrivateKey * | privateKey | ||
) |
Decode a PEM file containing a EdDSA private key.
- Parameters
-
[in] input Pointer to the PEM encoding [in] length Length of the PEM encoding [in] password NULL-terminated string containing the password. This parameter is required if the private key is encrypted [out] privateKey EdDSA private key resulting from the parsing process
- Returns
- Error code
Definition at line 1450 of file pem_import.c.
◆ pemImportEddsaPublicKey()
error_t pemImportEddsaPublicKey | ( | const char_t * | input, |
size_t | length, | ||
EddsaPublicKey * | publicKey | ||
) |
Decode a PEM file containing a EdDSA public key.
- Parameters
-
[in] input Pointer to the PEM encoding [in] length Length of the PEM encoding [out] publicKey EdDSA public key resulting from the parsing process
- Returns
- Error code
Definition at line 1368 of file pem_import.c.
◆ pemImportRsaPrivateKey()
error_t pemImportRsaPrivateKey | ( | const char_t * | input, |
size_t | length, | ||
const char_t * | password, | ||
RsaPrivateKey * | privateKey | ||
) |
Decode a PEM file containing an RSA private key.
- Parameters
-
[in] input Pointer to the PEM encoding [in] length Length of the PEM encoding [in] password NULL-terminated string containing the password. This parameter is required if the private key is encrypted [out] privateKey RSA private key resulting from the parsing process
- Returns
- Error code
Definition at line 389 of file pem_import.c.
◆ pemImportRsaPublicKey()
error_t pemImportRsaPublicKey | ( | const char_t * | input, |
size_t | length, | ||
RsaPublicKey * | publicKey | ||
) |
Decode a PEM file containing an RSA public key.
- Parameters
-
[in] input Pointer to the PEM encoding [in] length Length of the PEM encoding [out] publicKey RSA public key resulting from the parsing process
- Returns
- Error code
Definition at line 260 of file pem_import.c.