X.509 certificate parsing. More...
Go to the source code of this file.
Functions | |
error_t | x509ParseCertificate (const uint8_t *data, size_t length, X509CertInfo *certInfo) |
Parse a X.509 certificate. More... | |
error_t | x509ParseCertificateEx (const uint8_t *data, size_t length, X509CertInfo *certInfo, bool_t ignoreUnknown) |
Parse a X.509 certificate. More... | |
error_t | x509ParseTbsCertificate (const uint8_t *data, size_t length, size_t *totalLength, X509TbsCertificate *tbsCert, bool_t ignoreUnknown) |
Parse TBSCertificate structure. More... | |
error_t | x509ParseVersion (const uint8_t *data, size_t length, size_t *totalLength, X509Version *version) |
Parse Version field. More... | |
error_t | x509ParseSerialNumber (const uint8_t *data, size_t length, size_t *totalLength, X509SerialNumber *serialNumber) |
Parse SerialNumber field. More... | |
error_t | x509ParseIssuerUniqueId (const uint8_t *data, size_t length, size_t *totalLength) |
Parse IssuerUniqueID structure. More... | |
error_t | x509ParseSubjectUniqueId (const uint8_t *data, size_t length, size_t *totalLength) |
Parse SubjectUniqueID structure. More... | |
error_t | x509ParseName (const uint8_t *data, size_t length, size_t *totalLength, X509Name *name) |
Parse Name structure. More... | |
error_t | x509ParseNameAttribute (const uint8_t *data, size_t length, size_t *totalLength, X509NameAttribute *nameAttribute) |
Parse name attribute. More... | |
error_t | x509ParseGeneralNames (const uint8_t *data, size_t length, X509GeneralName *generalNames, uint_t maxGeneralNames, uint_t *numGeneralNames) |
Parse GeneralNames field. More... | |
error_t | x509ParseGeneralName (const uint8_t *data, size_t length, size_t *totalLength, X509GeneralName *generalName) |
Parse GeneralName field. More... | |
error_t | x509ParseGeneralSubtrees (const uint8_t *data, size_t length) |
Parse GeneralSubtrees field. More... | |
error_t | x509ParseGeneralSubtree (const uint8_t *data, size_t length, size_t *totalLength, X509GeneralName *generalName) |
Parse GeneralSubtree field. More... | |
error_t | x509ParseValidity (const uint8_t *data, size_t length, size_t *totalLength, X509Validity *validity) |
Parse Validity structure. More... | |
error_t | x509ParseTime (const uint8_t *data, size_t length, size_t *totalLength, DateTime *dateTime) |
Parse UTCTime or GeneralizedTime field. More... | |
error_t | x509ParseInt (const uint8_t *data, size_t length, uint_t *value) |
Convert string to integer. More... | |
Detailed Description
X.509 certificate parsing.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 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.4.4
Definition in file x509_cert_parse.h.
Function Documentation
◆ x509ParseCertificate()
error_t x509ParseCertificate | ( | const uint8_t * | data, |
size_t | length, | ||
X509CertInfo * | certInfo | ||
) |
Parse a X.509 certificate.
- Parameters
-
[in] data Pointer to the X.509 certificate to parse [in] length Length of the X.509 certificate [out] certInfo Information resulting from the parsing process
- Returns
- Error code
Definition at line 56 of file x509_cert_parse.c.
◆ x509ParseCertificateEx()
error_t x509ParseCertificateEx | ( | const uint8_t * | data, |
size_t | length, | ||
X509CertInfo * | certInfo, | ||
bool_t | ignoreUnknown | ||
) |
Parse a X.509 certificate.
- Parameters
-
[in] data Pointer to the X.509 certificate to parse [in] length Length of the X.509 certificate [out] certInfo Information resulting from the parsing process [in] ignoreUnknown Ignore unknown extensions
- Returns
- Error code
Definition at line 73 of file x509_cert_parse.c.
◆ x509ParseGeneralName()
error_t x509ParseGeneralName | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
X509GeneralName * | generalName | ||
) |
Parse GeneralName field.
- 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] generalName Information resulting from the parsing process
- Returns
- Error code
Definition at line 855 of file x509_cert_parse.c.
◆ x509ParseGeneralNames()
error_t x509ParseGeneralNames | ( | const uint8_t * | data, |
size_t | length, | ||
X509GeneralName * | generalNames, | ||
uint_t | maxGeneralNames, | ||
uint_t * | numGeneralNames | ||
) |
Parse GeneralNames field.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] generalNames Array of GeneralName entries [in] maxGeneralNames Maximum number of entries the array can hold [out] numGeneralNames Actual number of entries in the array
- Returns
- Error code
Definition at line 805 of file x509_cert_parse.c.
◆ x509ParseGeneralSubtree()
error_t x509ParseGeneralSubtree | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
X509GeneralName * | generalName | ||
) |
Parse GeneralSubtree field.
- 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] generalName Information resulting from the parsing process
- Returns
- Error code
Definition at line 935 of file x509_cert_parse.c.
◆ x509ParseGeneralSubtrees()
error_t x509ParseGeneralSubtrees | ( | const uint8_t * | data, |
size_t | length | ||
) |
Parse GeneralSubtrees field.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure
- Returns
- Error code
Definition at line 901 of file x509_cert_parse.c.
◆ x509ParseInt()
Convert string to integer.
- Parameters
-
[in] data String containing the representation of an integral number [in] length Length of the string [out] value On success, the function returns the converted integral number
- Returns
- Error code
Definition at line 1156 of file x509_cert_parse.c.
◆ x509ParseIssuerUniqueId()
error_t x509ParseIssuerUniqueId | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength | ||
) |
Parse IssuerUniqueID 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
- Returns
- Error code
Definition at line 428 of file x509_cert_parse.c.
◆ x509ParseName()
error_t x509ParseName | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
X509Name * | name | ||
) |
Parse Name 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] name Information resulting from the parsing process
- Returns
- Error code
Definition at line 535 of file x509_cert_parse.c.
◆ x509ParseNameAttribute()
error_t x509ParseNameAttribute | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
X509NameAttribute * | nameAttribute | ||
) |
Parse name attribute.
- 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] nameAttribute Information resulting from the parsing process
- Returns
- Error code
Definition at line 732 of file x509_cert_parse.c.
◆ x509ParseSerialNumber()
error_t x509ParseSerialNumber | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
X509SerialNumber * | serialNumber | ||
) |
Parse SerialNumber field.
- 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] serialNumber Information resulting from the parsing process
- Returns
- Error code
Definition at line 381 of file x509_cert_parse.c.
◆ x509ParseSubjectUniqueId()
error_t x509ParseSubjectUniqueId | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength | ||
) |
Parse SubjectUniqueID 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
- Returns
- Error code
Definition at line 481 of file x509_cert_parse.c.
◆ x509ParseTbsCertificate()
error_t x509ParseTbsCertificate | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
X509TbsCertificate * | tbsCert, | ||
bool_t | ignoreUnknown | ||
) |
Parse TBSCertificate 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] tbsCert Information resulting from the parsing process [in] ignoreUnknown Ignore unknown extensions
- Returns
- Error code
Definition at line 156 of file x509_cert_parse.c.
◆ x509ParseTime()
error_t x509ParseTime | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
DateTime * | dateTime | ||
) |
Parse UTCTime or GeneralizedTime field.
- 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] dateTime date resulting from the parsing process
- Returns
- Error code
Definition at line 1021 of file x509_cert_parse.c.
◆ x509ParseValidity()
error_t x509ParseValidity | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
X509Validity * | validity | ||
) |
Parse Validity 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] validity Information resulting from the parsing process
- Returns
- Error code
Definition at line 968 of file x509_cert_parse.c.
◆ x509ParseVersion()
error_t x509ParseVersion | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
X509Version * | version | ||
) |
Parse Version field.
- 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] version Information resulting from the parsing process
- Returns
- Error code
Definition at line 320 of file x509_cert_parse.c.