SSH certificate import functions. More...
#include "ssh/ssh.h"#include "ssh/ssh_cert_import.h"#include "ssh/ssh_misc.h"#include "encoding/base64.h"#include "pkc/rsa.h"#include "pkc/dsa.h"#include "ecc/ec.h"#include "ecc/eddsa.h"#include "debug.h"Go to the source code of this file.
| Macros | |
| #define | TRACE_LEVEL SSH_TRACE_LEVEL | 
| Functions | |
| error_t | sshImportCertificate (const char_t *input, size_t inputLen, uint8_t *output, size_t *outputLen) | 
| Import SSH certificate (OpenSSH format)  More... | |
| error_t | sshImportRsaCertPublicKey (RsaPublicKey *publicKey, const SshCertificate *cert) | 
| Import an RSA public key from a certificate.  More... | |
| error_t | sshImportDsaCertPublicKey (DsaPublicKey *publicKey, const SshCertificate *cert) | 
| Import a DSA public key from a certificate.  More... | |
| error_t | sshImportEcdsaCertPublicKey (EcPublicKey *publicKey, const SshCertificate *cert) | 
| Import an ECDSA public key from a certificate.  More... | |
| error_t | sshImportEd25519CertPublicKey (EddsaPublicKey *publicKey, const SshCertificate *cert) | 
| Import an Ed25519 public key from a certificate.  More... | |
| error_t | sshImportEd448CertPublicKey (EddsaPublicKey *publicKey, const SshCertificate *cert) | 
| Import an Ed448 public key from a certificate.  More... | |
| const char_t * | sshGetCertType (const char_t *input, size_t length) | 
| Get SSH certificate type.  More... | |
Detailed Description
SSH certificate import functions.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2019-2025 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneSSH 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.4
Definition in file ssh_cert_import.c.
Macro Definition Documentation
◆ TRACE_LEVEL
| #define TRACE_LEVEL SSH_TRACE_LEVEL | 
Definition at line 32 of file ssh_cert_import.c.
Function Documentation
◆ sshGetCertType()
Get SSH certificate type.
- Parameters
- 
  [in] input SSH certificate file [in] length Length of the SSH certificate file 
- Returns
- SSH certificate type
Definition at line 398 of file ssh_cert_import.c.
◆ sshImportCertificate()
| error_t sshImportCertificate | ( | const char_t * | input, | 
| size_t | inputLen, | ||
| uint8_t * | output, | ||
| size_t * | outputLen | ||
| ) | 
Import SSH certificate (OpenSSH format)
- Parameters
- 
  [in] input SSH certificate file to decode [in] inputLen Length of the SSH certificate file to decode [out] output Pointer to the decoded data (optional parameter) [out] outputLen Length of the decoded data 
- Returns
- Error code
Definition at line 94 of file ssh_cert_import.c.
◆ sshImportDsaCertPublicKey()
| error_t sshImportDsaCertPublicKey | ( | DsaPublicKey * | publicKey, | 
| const SshCertificate * | cert | ||
| ) | 
Import a DSA public key from a certificate.
- Parameters
- 
  [out] publicKey Pointer to the DSA public key [in] cert Pointer to the certificate structure 
- Returns
- Error code
Definition at line 203 of file ssh_cert_import.c.
◆ sshImportEcdsaCertPublicKey()
| error_t sshImportEcdsaCertPublicKey | ( | EcPublicKey * | publicKey, | 
| const SshCertificate * | cert | ||
| ) | 
Import an ECDSA public key from a certificate.
- Parameters
- 
  [out] publicKey Pointer to the ECDSA public key [in] cert Pointer to the certificate structure 
- Returns
- Error code
Definition at line 268 of file ssh_cert_import.c.
◆ sshImportEd25519CertPublicKey()
| error_t sshImportEd25519CertPublicKey | ( | EddsaPublicKey * | publicKey, | 
| const SshCertificate * | cert | ||
| ) | 
Import an Ed25519 public key from a certificate.
- Parameters
- 
  [out] publicKey Pointer to the EdDSA public key [in] cert Pointer to the certificate structure 
- Returns
- Error code
Definition at line 325 of file ssh_cert_import.c.
◆ sshImportEd448CertPublicKey()
| error_t sshImportEd448CertPublicKey | ( | EddsaPublicKey * | publicKey, | 
| const SshCertificate * | cert | ||
| ) | 
Import an Ed448 public key from a certificate.
- Parameters
- 
  [out] publicKey Pointer to the EdDSA public key [in] cert Pointer to the certificate structure 
- Returns
- Error code
Definition at line 362 of file ssh_cert_import.c.
◆ sshImportRsaCertPublicKey()
| error_t sshImportRsaCertPublicKey | ( | RsaPublicKey * | publicKey, | 
| const SshCertificate * | cert | ||
| ) | 
Import an RSA public key from a certificate.
- Parameters
- 
  [out] publicKey Pointer to the RSA public key [in] cert Pointer to the certificate structure 
- Returns
- Error code
Definition at line 152 of file ssh_cert_import.c.
