ssh_cert_import.h
Go to the documentation of this file.
1 /**
2  * @file ssh_cert_import.h
3  * @brief SSH certificate import functions
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2019-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneSSH 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.4.0
29  **/
30 
31 #ifndef _SSH_CERT_IMPORT_H
32 #define _SSH_CERT_IMPORT_H
33 
34 //Dependencies
35 #include "ssh_types.h"
36 #include "ssh_cert_parse.h"
37 #include "pkc/rsa.h"
38 #include "pkc/dsa.h"
39 #include "ecc/ec.h"
40 #include "ecc/eddsa.h"
41 
42 //C++ guard
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 //SSH certificate import functions
48 error_t sshImportCertificate(const char_t *input, size_t inputLen,
49  uint8_t *output, size_t *outputLen);
50 
52  RsaPublicKey *publicKey);
53 
55  DsaPublicKey *publicKey);
56 
58  EcDomainParameters *params, EcPublicKey *publicKey);
59 
61  EddsaPublicKey *publicKey);
62 
63 const char_t *sshGetCertType(const char_t *input, size_t length);
64 
65 //C++ guard
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif
char char_t
Definition: compiler_port.h:48
DSA (Digital Signature Algorithm)
ECC (Elliptic Curve Cryptography)
EdDSA (Edwards-Curve Digital Signature Algorithm)
error_t
Error codes.
Definition: error.h:43
RSA public-key cryptography standard.
error_t sshImportCertificate(const char_t *input, size_t inputLen, uint8_t *output, size_t *outputLen)
Import SSH certificate (OpenSSH format)
error_t sshImportRsaCertPublicKey(const SshCertificate *cert, RsaPublicKey *publicKey)
Import an RSA public key from a certificate.
error_t sshImportEd25519CertPublicKey(const SshCertificate *cert, EddsaPublicKey *publicKey)
Import an Ed25519 public key from a certificate.
error_t sshImportEcdsaCertPublicKey(const SshCertificate *cert, EcDomainParameters *params, EcPublicKey *publicKey)
Import an ECDSA public key from a certificate.
const char_t * sshGetCertType(const char_t *input, size_t length)
Get SSH certificate type.
error_t sshImportDsaCertPublicKey(const SshCertificate *cert, DsaPublicKey *publicKey)
Import a DSA public key from a certificate.
SSH certificate parsing.
SSH data type representations.
DSA public key.
Definition: dsa.h:61
EC domain parameters.
Definition: ec.h:76
EC public key.
Definition: ec.h:94
EdDSA public key.
Definition: eddsa.h:49
RSA public key.
Definition: rsa.h:57
SSH certificate (OpenSSH format)
uint8_t length
Definition: tcp.h:368