PKCS #8 key parsing. More...
Go to the source code of this file.
Data Structures | |
struct | Pkcs8RsaPrivateKey |
RSA private key. More... | |
struct | Pkcs8DsaPrivateKey |
DSA private key. More... | |
struct | Pkcs8EcPrivateKey |
EC private key. More... | |
struct | Pkcs8EddsaPrivateKey |
EdDSA private key. More... | |
struct | Pkcs8EddsaPublicKey |
EdDSA public key. More... | |
struct | Pkcs8PrivateKeyInfo |
Private key information. More... | |
struct | Pkcs8EncryptedPrivateKeyInfo |
Encrypted private key information. More... | |
Functions | |
error_t | pkcs8ParsePrivateKeyInfo (const uint8_t *data, size_t length, Pkcs8PrivateKeyInfo *privateKeyInfo) |
Parse PrivateKeyInfo structure. More... | |
error_t | pkcs8ParsePrivateKeyAlgo (const uint8_t *data, size_t length, size_t *totalLength, Pkcs8PrivateKeyInfo *privateKeyInfo) |
Parse PrivateKeyAlgorithm structure. More... | |
error_t | pkcs8ParseRsaPrivateKey (const uint8_t *data, size_t length, Pkcs8RsaPrivateKey *rsaPrivateKey) |
Parse RSAPrivateKey structure. More... | |
error_t | pkcs8ParseDsaPrivateKey (const uint8_t *data, size_t length, X509DsaParameters *dsaParams, Pkcs8DsaPrivateKey *dsaPrivateKey, X509DsaPublicKey *dsaPublicKey) |
Parse DSAPrivateKey structure. More... | |
error_t | pkcs8ParseEcPrivateKey (const uint8_t *data, size_t length, X509EcParameters *ecParams, Pkcs8EcPrivateKey *ecPrivateKey, X509EcPublicKey *ecPublicKey) |
Parse ECPrivateKey structure. More... | |
error_t | pkcs8ParseEcPublicKey (const uint8_t *data, size_t length, X509EcPublicKey *ecPublicKey) |
Parse publicKey structure. More... | |
error_t | pkcs8ParseEddsaPrivateKey (const uint8_t *data, size_t length, Pkcs8EddsaPrivateKey *eddsaPrivateKey) |
Parse CurvePrivateKey structure. More... | |
error_t | pkcs8ParseEddsaPublicKey (const uint8_t *data, size_t length, Pkcs8EddsaPublicKey *eddsaPublicKey) |
Parse publicKey structure. More... | |
error_t | pkcs8ParseEncryptedPrivateKeyInfo (const uint8_t *data, size_t length, Pkcs8EncryptedPrivateKeyInfo *encryptedPrivateKeyInfo) |
Parse EncryptedPrivateKeyInfo structure. More... | |
error_t | pkcs8ParseEncryptionAlgoId (const uint8_t *data, size_t length, size_t *totalLength, X509AlgoId *encryptionAlgoId) |
Parse EncryptionAlgorithmIdentifier structure. More... | |
error_t | pkcs8ImportRsaPrivateKey (RsaPrivateKey *privateKey, const Pkcs8PrivateKeyInfo *privateKeyInfo) |
Import an RSA private key. More... | |
error_t | pkcs8ImportDsaPrivateKey (DsaPrivateKey *privateKey, const Pkcs8PrivateKeyInfo *privateKeyInfo) |
Import a DSA private key. More... | |
error_t | pkcs8ImportEcPrivateKey (EcPrivateKey *privateKey, const Pkcs8PrivateKeyInfo *privateKeyInfo) |
Import an EC private key. More... | |
error_t | pkcs8ImportEddsaPrivateKey (EddsaPrivateKey *privateKey, const Pkcs8PrivateKeyInfo *privateKeyInfo) |
Import an EdDSA private key. More... | |
Detailed Description
PKCS #8 key parsing.
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_parse.h.
Function Documentation
◆ pkcs8ImportDsaPrivateKey()
error_t pkcs8ImportDsaPrivateKey | ( | DsaPrivateKey * | privateKey, |
const Pkcs8PrivateKeyInfo * | privateKeyInfo | ||
) |
Import a DSA private key.
- Parameters
-
[out] privateKey DSA private key [in] privateKeyInfo Private key information
- Returns
- Error code
Definition at line 1112 of file pkcs8_key_parse.c.
◆ pkcs8ImportEcPrivateKey()
error_t pkcs8ImportEcPrivateKey | ( | EcPrivateKey * | privateKey, |
const Pkcs8PrivateKeyInfo * | privateKeyInfo | ||
) |
Import an EC private key.
- Parameters
-
[out] privateKey EC private key [in] privateKeyInfo Private key information
- Returns
- Error code
Definition at line 1207 of file pkcs8_key_parse.c.
◆ pkcs8ImportEddsaPrivateKey()
error_t pkcs8ImportEddsaPrivateKey | ( | EddsaPrivateKey * | privateKey, |
const Pkcs8PrivateKeyInfo * | privateKeyInfo | ||
) |
Import an EdDSA private key.
- Parameters
-
[out] privateKey EdDSA private key [in] privateKeyInfo Private key information
- Returns
- Error code
Definition at line 1304 of file pkcs8_key_parse.c.
◆ pkcs8ImportRsaPrivateKey()
error_t pkcs8ImportRsaPrivateKey | ( | RsaPrivateKey * | privateKey, |
const Pkcs8PrivateKeyInfo * | privateKeyInfo | ||
) |
Import an RSA private key.
- Parameters
-
[out] privateKey RSA private key [in] privateKeyInfo Private key information
- Returns
- Error code
Definition at line 976 of file pkcs8_key_parse.c.
◆ pkcs8ParseDsaPrivateKey()
error_t pkcs8ParseDsaPrivateKey | ( | const uint8_t * | data, |
size_t | length, | ||
X509DsaParameters * | dsaParams, | ||
Pkcs8DsaPrivateKey * | dsaPrivateKey, | ||
X509DsaPublicKey * | dsaPublicKey | ||
) |
Parse DSAPrivateKey structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] dsaParams DSA domain parameters [out] dsaPrivateKey DSA private key [out] dsaPublicKey DSA public key
- Returns
- Error code
Definition at line 536 of file pkcs8_key_parse.c.
◆ pkcs8ParseEcPrivateKey()
error_t pkcs8ParseEcPrivateKey | ( | const uint8_t * | data, |
size_t | length, | ||
X509EcParameters * | ecParams, | ||
Pkcs8EcPrivateKey * | ecPrivateKey, | ||
X509EcPublicKey * | ecPublicKey | ||
) |
Parse ECPrivateKey structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] ecParams EC domain parameters [out] ecPrivateKey EC private key [out] ecPublicKey EC public key
- Returns
- Error code
Definition at line 683 of file pkcs8_key_parse.c.
◆ pkcs8ParseEcPublicKey()
error_t pkcs8ParseEcPublicKey | ( | const uint8_t * | data, |
size_t | length, | ||
X509EcPublicKey * | ecPublicKey | ||
) |
Parse publicKey structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] ecPublicKey EC public key
- Returns
- Error code
Definition at line 779 of file pkcs8_key_parse.c.
◆ pkcs8ParseEddsaPrivateKey()
error_t pkcs8ParseEddsaPrivateKey | ( | const uint8_t * | data, |
size_t | length, | ||
Pkcs8EddsaPrivateKey * | eddsaPrivateKey | ||
) |
Parse CurvePrivateKey structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] eddsaPrivateKey EdDSA private key
- Returns
- Error code
Definition at line 820 of file pkcs8_key_parse.c.
◆ pkcs8ParseEddsaPublicKey()
error_t pkcs8ParseEddsaPublicKey | ( | const uint8_t * | data, |
size_t | length, | ||
Pkcs8EddsaPublicKey * | eddsaPublicKey | ||
) |
Parse publicKey structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] eddsaPublicKey EdDSA public key
- Returns
- Error code
Definition at line 849 of file pkcs8_key_parse.c.
◆ pkcs8ParseEncryptedPrivateKeyInfo()
error_t pkcs8ParseEncryptedPrivateKeyInfo | ( | const uint8_t * | data, |
size_t | length, | ||
Pkcs8EncryptedPrivateKeyInfo * | encryptedPrivateKeyInfo | ||
) |
Parse EncryptedPrivateKeyInfo structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] encryptedPrivateKeyInfo Information resulting from the parsing process
- Returns
- Error code
Definition at line 874 of file pkcs8_key_parse.c.
◆ pkcs8ParseEncryptionAlgoId()
error_t pkcs8ParseEncryptionAlgoId | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
X509AlgoId * | encryptionAlgoId | ||
) |
Parse EncryptionAlgorithmIdentifier structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] totalLength Number of bytes that have been parsed [out] encryptionAlgoId Information resulting from the parsing process
- Returns
- Error code
Definition at line 926 of file pkcs8_key_parse.c.
◆ pkcs8ParsePrivateKeyAlgo()
error_t pkcs8ParsePrivateKeyAlgo | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
Pkcs8PrivateKeyInfo * | privateKeyInfo | ||
) |
Parse PrivateKeyAlgorithm structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] totalLength Number of bytes that have been parsed [out] privateKeyInfo Information resulting from the parsing process
- Returns
- Error code
Definition at line 230 of file pkcs8_key_parse.c.
◆ pkcs8ParsePrivateKeyInfo()
error_t pkcs8ParsePrivateKeyInfo | ( | const uint8_t * | data, |
size_t | length, | ||
Pkcs8PrivateKeyInfo * | privateKeyInfo | ||
) |
Parse PrivateKeyInfo structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] privateKeyInfo Information resulting from the parsing process
- Returns
- Error code
Definition at line 55 of file pkcs8_key_parse.c.
◆ pkcs8ParseRsaPrivateKey()
error_t pkcs8ParseRsaPrivateKey | ( | const uint8_t * | data, |
size_t | length, | ||
Pkcs8RsaPrivateKey * | rsaPrivateKey | ||
) |
Parse RSAPrivateKey structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] rsaPrivateKey Information resulting from the parsing process
- Returns
- Error code
Definition at line 339 of file pkcs8_key_parse.c.