x509_key_parse.h File Reference

Parsing of ASN.1 encoded keys. More...

#include "core/crypto.h"
#include "pkix/x509_common.h"

Go to the source code of this file.

Functions

error_t x509ParseSubjectPublicKeyInfo (const uint8_t *data, size_t length, size_t *totalLength, X509SubjectPublicKeyInfo *subjectPublicKeyInfo)
 Parse SubjectPublicKeyInfo structure. More...
 
error_t x509ParseAlgoId (const uint8_t *data, size_t length, size_t *totalLength, X509SubjectPublicKeyInfo *subjectPublicKeyInfo)
 Parse AlgorithmIdentifier structure. More...
 
error_t x509ParseRsaPublicKey (const uint8_t *data, size_t length, X509RsaPublicKey *rsaPublicKey)
 Parse RSAPublicKey structure. More...
 
error_t x509ParseDsaPublicKey (const uint8_t *data, size_t length, X509DsaPublicKey *dsaPublicKey)
 Parse DSAPublicKey structure. More...
 
error_t x509ParseDsaParameters (const uint8_t *data, size_t length, X509DsaParameters *dsaParams)
 Parse DSA domain parameters. More...
 
error_t x509ParseEcPublicKey (const uint8_t *data, size_t length, X509EcPublicKey *ecPublicKey)
 Parse ECPublicKey structure. More...
 
error_t x509ParseEcParameters (const uint8_t *data, size_t length, X509EcParameters *ecParams)
 Parse ECParameters structure. More...
 
error_t x509ImportRsaPublicKey (RsaPublicKey *publicKey, const X509SubjectPublicKeyInfo *publicKeyInfo)
 Import an RSA public key. More...
 
error_t x509ImportDsaPublicKey (DsaPublicKey *publicKey, const X509SubjectPublicKeyInfo *publicKeyInfo)
 Import a DSA public key. More...
 
error_t x509ImportEcPublicKey (EcPublicKey *publicKey, const X509SubjectPublicKeyInfo *publicKeyInfo)
 Import an EC public key. More...
 
error_t x509ImportEddsaPublicKey (EddsaPublicKey *publicKey, const X509SubjectPublicKeyInfo *publicKeyInfo)
 Import an EdDSA public key. More...
 

Detailed Description

Parsing of ASN.1 encoded keys.

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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.5.0

Definition in file x509_key_parse.h.

Function Documentation

◆ x509ImportDsaPublicKey()

error_t x509ImportDsaPublicKey ( DsaPublicKey publicKey,
const X509SubjectPublicKeyInfo publicKeyInfo 
)

Import a DSA public key.

Parameters
[out]publicKeyDSA public key
[in]publicKeyInfoPublic key information
Returns
Error code

Definition at line 633 of file x509_key_parse.c.

◆ x509ImportEcPublicKey()

error_t x509ImportEcPublicKey ( EcPublicKey publicKey,
const X509SubjectPublicKeyInfo publicKeyInfo 
)

Import an EC public key.

Parameters
[out]publicKeyEC public key
[in]publicKeyInfoPublic key information
Returns
Error code

Definition at line 718 of file x509_key_parse.c.

◆ x509ImportEddsaPublicKey()

error_t x509ImportEddsaPublicKey ( EddsaPublicKey publicKey,
const X509SubjectPublicKeyInfo publicKeyInfo 
)

Import an EdDSA public key.

Parameters
[out]publicKeyEdDSA public key
[in]publicKeyInfoPublic key information
Returns
Error code

Definition at line 788 of file x509_key_parse.c.

◆ x509ImportRsaPublicKey()

error_t x509ImportRsaPublicKey ( RsaPublicKey publicKey,
const X509SubjectPublicKeyInfo publicKeyInfo 
)

Import an RSA public key.

Parameters
[out]publicKeyRSA public key
[in]publicKeyInfoPublic key information
Returns
Error code

Definition at line 563 of file x509_key_parse.c.

◆ x509ParseAlgoId()

error_t x509ParseAlgoId ( const uint8_t *  data,
size_t  length,
size_t *  totalLength,
X509SubjectPublicKeyInfo publicKeyInfo 
)

Parse AlgorithmIdentifier structure.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]publicKeyInfoInformation resulting from the parsing process
Returns
Error code

Definition at line 197 of file x509_key_parse.c.

◆ x509ParseDsaParameters()

error_t x509ParseDsaParameters ( const uint8_t *  data,
size_t  length,
X509DsaParameters dsaParams 
)

Parse DSA domain parameters.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]dsaParamsInformation resulting from the parsing process
Returns
Error code

Definition at line 415 of file x509_key_parse.c.

◆ x509ParseDsaPublicKey()

error_t x509ParseDsaPublicKey ( const uint8_t *  data,
size_t  length,
X509DsaPublicKey dsaPublicKey 
)

Parse DSAPublicKey structure.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]dsaPublicKeyInformation resulting from the parsing process
Returns
Error code

Definition at line 377 of file x509_key_parse.c.

◆ x509ParseEcParameters()

error_t x509ParseEcParameters ( const uint8_t *  data,
size_t  length,
X509EcParameters ecParams 
)

Parse ECParameters structure.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]ecParamsInformation resulting from the parsing process
Returns
Error code

Definition at line 530 of file x509_key_parse.c.

◆ x509ParseEcPublicKey()

error_t x509ParseEcPublicKey ( const uint8_t *  data,
size_t  length,
X509EcPublicKey ecPublicKey 
)

Parse ECPublicKey structure.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]ecPublicKeyInformation resulting from the parsing process
Returns
Error code

Definition at line 503 of file x509_key_parse.c.

◆ x509ParseRsaPublicKey()

error_t x509ParseRsaPublicKey ( const uint8_t *  data,
size_t  length,
X509RsaPublicKey rsaPublicKey 
)

Parse RSAPublicKey structure.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]rsaPublicKeyInformation resulting from the parsing process
Returns
Error code

Definition at line 309 of file x509_key_parse.c.

◆ x509ParseSubjectPublicKeyInfo()

error_t x509ParseSubjectPublicKeyInfo ( const uint8_t *  data,
size_t  length,
size_t *  totalLength,
X509SubjectPublicKeyInfo publicKeyInfo 
)

Parse SubjectPublicKeyInfo structure.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]publicKeyInfoInformation resulting from the parsing process
Returns
Error code

Definition at line 56 of file x509_key_parse.c.