PKCS #8 key formatting. More...
#include "core/crypto.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 | pkcs8FormatRsaPrivateKey (const RsaPrivateKey *privateKey, uint8_t *output, size_t *written) |
Format an RSA private key. More... | |
error_t | pkcs8FormatDsaPrivateKey (const DsaPrivateKey *privateKey, uint8_t *output, size_t *written) |
Format a DSA private key. More... | |
error_t | pkcs8FormatEcPrivateKey (const EcPrivateKey *privateKey, uint8_t *output, size_t *written) |
Format an EC private key. More... | |
error_t | pkcs8FormatEcPublicKey (const EcPublicKey *publicKey, uint8_t *output, size_t *written) |
Format an EC public key. More... | |
error_t | pkcs8FormatEddsaPrivateKey (const EddsaPrivateKey *privateKey, uint8_t *output, size_t *written) |
Format an EdDSA private key. More... | |
error_t | pkcs8FormatEddsaPublicKey (const EddsaPublicKey *publicKey, uint8_t *output, size_t *written) |
Format an EdDSA public key. More... | |
Detailed Description
PKCS #8 key formatting.
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.0
Definition in file pkcs8_key_format.h.
Function Documentation
◆ pkcs8FormatDsaPrivateKey()
error_t pkcs8FormatDsaPrivateKey | ( | const DsaPrivateKey * | privateKey, |
uint8_t * | output, | ||
size_t * | written | ||
) |
Format a DSA private key.
- Parameters
-
[in] privateKey Pointer to the RSA private key [out] output Buffer where to store the ASN.1 structure [out] written Length of the resulting ASN.1 structure
- Returns
- Error code
Definition at line 92 of file pkcs8_key_format.c.
◆ pkcs8FormatEcPrivateKey()
error_t pkcs8FormatEcPrivateKey | ( | const EcPrivateKey * | privateKey, |
uint8_t * | output, | ||
size_t * | written | ||
) |
Format an EC private key.
- Parameters
-
[in] privateKey EC private key [out] output Buffer where to format the ASN.1 structure [out] written Length of the resulting ASN.1 structure
- Returns
- Error code
Definition at line 129 of file pkcs8_key_format.c.
◆ pkcs8FormatEcPublicKey()
error_t pkcs8FormatEcPublicKey | ( | const EcPublicKey * | publicKey, |
uint8_t * | output, | ||
size_t * | written | ||
) |
Format an EC public key.
- Parameters
-
[in] publicKey EC public key [out] output Buffer where to format the ASN.1 structure [out] written Length of the resulting ASN.1 structure
- Returns
- Error code
Definition at line 252 of file pkcs8_key_format.c.
◆ pkcs8FormatEddsaPrivateKey()
error_t pkcs8FormatEddsaPrivateKey | ( | const EddsaPrivateKey * | privateKey, |
uint8_t * | output, | ||
size_t * | written | ||
) |
Format an EdDSA private key.
- Parameters
-
[in] privateKey EdDSA private key [out] output Buffer where to format the ASN.1 structure [out] written Length of the resulting ASN.1 structure
- Returns
- Error code
Definition at line 313 of file pkcs8_key_format.c.
◆ pkcs8FormatEddsaPublicKey()
error_t pkcs8FormatEddsaPublicKey | ( | const EddsaPublicKey * | publicKey, |
uint8_t * | output, | ||
size_t * | written | ||
) |
Format an EdDSA public key.
- Parameters
-
[in] publicKey EdDSA public key [out] output Buffer where to format the ASN.1 structure [out] written Length of the resulting ASN.1 structure
- Returns
- Error code
Definition at line 355 of file pkcs8_key_format.c.
◆ pkcs8FormatRsaPrivateKey()
error_t pkcs8FormatRsaPrivateKey | ( | const RsaPrivateKey * | privateKey, |
uint8_t * | output, | ||
size_t * | written | ||
) |
Format an RSA private key.
- Parameters
-
[in] privateKey Pointer to the RSA private key [out] output Buffer where to store the ASN.1 structure [out] written Length of the resulting ASN.1 structure
- Returns
- Error code
Definition at line 55 of file pkcs8_key_format.c.