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 x509ParseAlgorithmIdentifier (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 x509ParseRsaPssParameters (const uint8_t *data, size_t length, X509RsaPssParameters *rsaPssParams)
 Parse RSASSA-PSS parameters. More...
 
error_t x509ParseRsaPssHashAlgo (const uint8_t *data, size_t length, X509RsaPssParameters *rsaPssParams)
 Parse RSASSA-PSS hash algorithm. More...
 
error_t x509ParseRsaPssMaskGenAlgo (const uint8_t *data, size_t length, X509RsaPssParameters *rsaPssParams)
 Parse RSASSA-PSS mask generation algorithm. More...
 
error_t x509ParseRsaPssMaskGenHashAlgo (const uint8_t *data, size_t length, X509RsaPssParameters *rsaPssParams)
 Parse RSASSA-PSS mask generation hash algorithm. More...
 
error_t x509ParseRsaPssSaltLength (const uint8_t *data, size_t length, X509RsaPssParameters *rsaPssParams)
 Parse RSASSA-PSS salt length. 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 (const X509SubjectPublicKeyInfo *publicKeyInfo, RsaPublicKey *publicKey)
 Import an RSA public key. More...
 
error_t x509ImportDsaPublicKey (const X509SubjectPublicKeyInfo *publicKeyInfo, DsaPublicKey *publicKey)
 Import a DSA public key. More...
 
error_t x509ImportEcPublicKey (const X509SubjectPublicKeyInfo *publicKeyInfo, EcPoint *publicKey)
 Import an EC public key. More...
 
error_t x509ImportEcParameters (const X509EcParameters *ecParams, EcDomainParameters *params)
 Import EC domain parameters. More...
 
error_t x509ImportEddsaPublicKey (const X509SubjectPublicKeyInfo *publicKeyInfo, EddsaPublicKey *publicKey)
 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-2019 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
1.9.6

Definition in file x509_key_parse.h.

Function Documentation

◆ x509ImportDsaPublicKey()

error_t x509ImportDsaPublicKey ( const X509SubjectPublicKeyInfo publicKeyInfo,
DsaPublicKey publicKey 
)

Import a DSA public key.

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

Definition at line 890 of file x509_key_parse.c.

◆ x509ImportEcParameters()

error_t x509ImportEcParameters ( const X509EcParameters ecParams,
EcDomainParameters params 
)

Import EC domain parameters.

Parameters
[in]ecParamsPointer to the ECParameters structure
[out]paramsEC domain parameters
Returns
Error code

Definition at line 1058 of file x509_key_parse.c.

◆ x509ImportEcPublicKey()

error_t x509ImportEcPublicKey ( const X509SubjectPublicKeyInfo publicKeyInfo,
EcPoint publicKey 
)

Import an EC public key.

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

Definition at line 975 of file x509_key_parse.c.

◆ x509ImportEddsaPublicKey()

error_t x509ImportEddsaPublicKey ( const X509SubjectPublicKeyInfo publicKeyInfo,
EddsaPublicKey publicKey 
)

Import an EdDSA public key.

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

Definition at line 1094 of file x509_key_parse.c.

◆ x509ImportRsaPublicKey()

error_t x509ImportRsaPublicKey ( const X509SubjectPublicKeyInfo publicKeyInfo,
RsaPublicKey publicKey 
)

Import an RSA public key.

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

Definition at line 820 of file x509_key_parse.c.

◆ x509ParseAlgorithmIdentifier()

error_t x509ParseAlgorithmIdentifier ( 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 193 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 672 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 634 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 787 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 760 of file x509_key_parse.c.

◆ x509ParseRsaPssHashAlgo()

error_t x509ParseRsaPssHashAlgo ( const uint8_t *  data,
size_t  length,
X509RsaPssParameters rsaPssParams 
)

Parse RSASSA-PSS hash algorithm.

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

Definition at line 472 of file x509_key_parse.c.

◆ x509ParseRsaPssMaskGenAlgo()

error_t x509ParseRsaPssMaskGenAlgo ( const uint8_t *  data,
size_t  length,
X509RsaPssParameters rsaPssParams 
)

Parse RSASSA-PSS mask generation algorithm.

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

Definition at line 511 of file x509_key_parse.c.

◆ x509ParseRsaPssMaskGenHashAlgo()

error_t x509ParseRsaPssMaskGenHashAlgo ( const uint8_t *  data,
size_t  length,
X509RsaPssParameters rsaPssParams 
)

Parse RSASSA-PSS mask generation hash algorithm.

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

Definition at line 561 of file x509_key_parse.c.

◆ x509ParseRsaPssParameters()

error_t x509ParseRsaPssParameters ( const uint8_t *  data,
size_t  length,
X509RsaPssParameters rsaPssParams 
)

Parse RSASSA-PSS parameters.

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

Definition at line 375 of file x509_key_parse.c.

◆ x509ParseRsaPssSaltLength()

error_t x509ParseRsaPssSaltLength ( const uint8_t *  data,
size_t  length,
X509RsaPssParameters rsaPssParams 
)

Parse RSASSA-PSS salt length.

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

Definition at line 601 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 307 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 57 of file x509_key_parse.c.