PEM key file import functions. More...
#include "core/crypto.h"
#include "pkix/pem_common.h"
#include "pkix/x509_common.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 | pemImportRsaPublicKey (RsaPublicKey *publicKey, const char_t *input, size_t length) |
Decode a PEM file containing an RSA public key. More... | |
error_t | pemImportRsaPrivateKey (RsaPrivateKey *privateKey, const char_t *input, size_t length, const char_t *password) |
Decode a PEM file containing an RSA private key. More... | |
error_t | pemImportDsaPublicKey (DsaPublicKey *publicKey, const char_t *input, size_t length) |
Decode a PEM file containing a DSA public key. More... | |
error_t | pemImportDsaPrivateKey (DsaPrivateKey *privateKey, const char_t *input, size_t length, const char_t *password) |
Decode a PEM file containing a DSA private key. More... | |
error_t | pemImportEcPublicKey (EcPublicKey *publicKey, const char_t *input, size_t length) |
Decode a PEM file containing an EC public key. More... | |
error_t | pemImportEcPrivateKey (EcPrivateKey *privateKey, const char_t *input, size_t length, const char_t *password) |
Decode a PEM file containing an EC private key. More... | |
error_t | pemImportEddsaPublicKey (EddsaPublicKey *publicKey, const char_t *input, size_t length) |
Decode a PEM file containing a EdDSA public key. More... | |
error_t | pemImportEddsaPrivateKey (EddsaPrivateKey *privateKey, const char_t *input, size_t length, const char_t *password) |
Decode a PEM file containing a EdDSA private key. More... | |
X509KeyType | pemGetPublicKeyType (const char_t *input, size_t length) |
Extract the public key type from a PEM file. More... | |
const EcCurve * | pemGetPublicKeyCurve (const char_t *input, size_t length) |
Extract elliptic curve parameters from a PEM file. More... | |
Detailed Description
PEM key file import functions.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2025 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.5.2
Definition in file pem_key_import.h.
Function Documentation
◆ pemGetPublicKeyCurve()
Extract elliptic curve parameters from a PEM file.
- Parameters
-
[in] input Pointer to the PEM string [in] length Length of the PEM string
- Returns
- Elliptic curve parameters
Definition at line 1259 of file pem_key_import.c.
◆ pemGetPublicKeyType()
X509KeyType pemGetPublicKeyType | ( | const char_t * | input, |
size_t | length | ||
) |
Extract the public key type from a PEM file.
- Parameters
-
[in] input Pointer to the PEM string [in] length Length of the PEM string
- Returns
- Public key type
Definition at line 1177 of file pem_key_import.c.
◆ pemImportDsaPrivateKey()
error_t pemImportDsaPrivateKey | ( | DsaPrivateKey * | privateKey, |
const char_t * | input, | ||
size_t | length, | ||
const char_t * | password | ||
) |
Decode a PEM file containing a DSA private key.
- Parameters
-
[out] privateKey DSA private key resulting from the parsing process [in] input Pointer to the PEM string [in] length Length of the PEM string [in] password NULL-terminated string containing the password. This parameter is required if the private key is encrypted
- Returns
- Error code
Definition at line 466 of file pem_key_import.c.
◆ pemImportDsaPublicKey()
error_t pemImportDsaPublicKey | ( | DsaPublicKey * | publicKey, |
const char_t * | input, | ||
size_t | length | ||
) |
Decode a PEM file containing a DSA public key.
- Parameters
-
[out] publicKey DSA public key resulting from the parsing process [in] input Pointer to the PEM string [in] length Length of the PEM string
- Returns
- Error code
Definition at line 386 of file pem_key_import.c.
◆ pemImportEcPrivateKey()
error_t pemImportEcPrivateKey | ( | EcPrivateKey * | privateKey, |
const char_t * | input, | ||
size_t | length, | ||
const char_t * | password | ||
) |
Decode a PEM file containing an EC private key.
- Parameters
-
[out] privateKey EC private key resulting from the parsing process [in] input Pointer to the PEM string [in] length Length of the PEM string [in] password NULL-terminated string containing the password. This parameter is required if the private key is encrypted
- Returns
- Error code
Definition at line 749 of file pem_key_import.c.
◆ pemImportEcPublicKey()
error_t pemImportEcPublicKey | ( | EcPublicKey * | publicKey, |
const char_t * | input, | ||
size_t | length | ||
) |
Decode a PEM file containing an EC public key.
- Parameters
-
[out] publicKey EC public key resulting from the parsing process [in] input Pointer to the PEM string [in] length Length of the PEM string
- Returns
- Error code
Definition at line 669 of file pem_key_import.c.
◆ pemImportEddsaPrivateKey()
error_t pemImportEddsaPrivateKey | ( | EddsaPrivateKey * | privateKey, |
const char_t * | input, | ||
size_t | length, | ||
const char_t * | password | ||
) |
Decode a PEM file containing a EdDSA private key.
- Parameters
-
[out] privateKey EdDSA private key resulting from the parsing process [in] input Pointer to the PEM string [in] length Length of the PEM string [in] password NULL-terminated string containing the password. This parameter is required if the private key is encrypted
- Returns
- Error code
Definition at line 1032 of file pem_key_import.c.
◆ pemImportEddsaPublicKey()
error_t pemImportEddsaPublicKey | ( | EddsaPublicKey * | publicKey, |
const char_t * | input, | ||
size_t | length | ||
) |
Decode a PEM file containing a EdDSA public key.
- Parameters
-
[out] publicKey EdDSA public key resulting from the parsing process [in] input Pointer to the PEM string [in] length Length of the PEM string
- Returns
- Error code
Definition at line 952 of file pem_key_import.c.
◆ pemImportRsaPrivateKey()
error_t pemImportRsaPrivateKey | ( | RsaPrivateKey * | privateKey, |
const char_t * | input, | ||
size_t | length, | ||
const char_t * | password | ||
) |
Decode a PEM file containing an RSA private key.
- Parameters
-
[out] privateKey RSA private key resulting from the parsing process [in] input Pointer to the PEM string [in] length Length of the PEM string [in] password NULL-terminated string containing the password. This parameter is required if the private key is encrypted
- Returns
- Error code
Definition at line 183 of file pem_key_import.c.
◆ pemImportRsaPublicKey()
error_t pemImportRsaPublicKey | ( | RsaPublicKey * | publicKey, |
const char_t * | input, | ||
size_t | length | ||
) |
Decode a PEM file containing an RSA public key.
- Parameters
-
[out] publicKey RSA public key resulting from the parsing process [in] input Pointer to the PEM string [in] length Length of the PEM string
- Returns
- Error code
Definition at line 56 of file pem_key_import.c.