pem_cert_key_import.h
Go to the documentation of this file.
1 /**
2  * @file pem_cert_key_import.h
3  * @brief PEM certificate public key import 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.0
29  **/
30 
31 #ifndef _PEM_CERT_KEY_IMPORT_H
32 #define _PEM_CERT_KEY_IMPORT_H
33 
34 //Dependencies
35 #include "core/crypto.h"
36 #include "pkix/pem_common.h"
37 #include "pkix/x509_common.h"
38 #include "pkc/rsa.h"
39 #include "pkc/dsa.h"
40 #include "ecc/ec.h"
41 #include "ecc/eddsa.h"
42 
43 //C++ guard
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 //PEM related functions
49 error_t pemImportRsaCertPublicKey(RsaPublicKey *publicKey, const char_t *input,
50  size_t length);
51 
52 error_t pemImportDsaCertPublicKey(DsaPublicKey *publicKey, const char_t *input,
53  size_t length);
54 
55 error_t pemImportEcCertPublicKey(EcPublicKey *publicKey, const char_t *input,
56  size_t length);
57 
59  const char_t *input, size_t length);
60 
61 X509KeyType pemGetCertPublicKeyType(const char_t *input, size_t length);
62 
63 //C++ guard
64 #ifdef __cplusplus
65 }
66 #endif
67 
68 #endif
X.509 common definitions.
error_t pemImportEddsaCertPublicKey(EddsaPublicKey *publicKey, const char_t *input, size_t length)
Extract the EdDSA public key from a PEM certificate.
PEM common definitions.
DSA public key.
Definition: dsa.h:61
error_t
Error codes.
Definition: error.h:43
EdDSA public key.
Definition: eddsa.h:64
error_t pemImportEcCertPublicKey(EcPublicKey *publicKey, const char_t *input, size_t length)
Extract the EC public key from a PEM certificate.
error_t pemImportDsaCertPublicKey(DsaPublicKey *publicKey, const char_t *input, size_t length)
Extract the DSA public key from a PEM certificate.
RSA public key.
Definition: rsa.h:57
EdDSA (Edwards-Curve Digital Signature Algorithm)
General definitions for cryptographic algorithms.
RSA public-key cryptography standard.
DSA (Digital Signature Algorithm)
uint8_t length
Definition: tcp.h:375
error_t pemImportRsaCertPublicKey(RsaPublicKey *publicKey, const char_t *input, size_t length)
Extract the RSA public key from a PEM certificate.
EC public key.
Definition: ec.h:421
char char_t
Definition: compiler_port.h:55
X509KeyType
Public Key types.
Definition: x509_common.h:633
ECC (Elliptic Curve Cryptography)
X509KeyType pemGetCertPublicKeyType(const char_t *input, size_t length)
Extract the type of the public key contained in a PEM certificate.