x509_cert_parse.c File Reference

X.509 certificate parsing. More...

#include "core/crypto.h"
#include "certificate/x509_cert_parse.h"
#include "encoding/asn1.h"
#include "encoding/oid.h"
#include "pkc/rsa.h"
#include "pkc/dsa.h"
#include "ecc/ecdsa.h"
#include "hash/md5.h"
#include "hash/sha1.h"
#include "hash/sha224.h"
#include "hash/sha256.h"
#include "hash/sha384.h"
#include "hash/sha512.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL
 

Functions

error_t x509ParseCertificate (const uint8_t *data, size_t length, X509CertificateInfo *certInfo)
 Parse a X.509 certificate. More...
 
error_t x509ParseTbsCertificate (const uint8_t *data, size_t length, size_t *totalLength, X509CertificateInfo *certInfo)
 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 x509ParseSignature (const uint8_t *data, size_t length, size_t *totalLength, X509SignatureAlgoId *signature)
 Parse Signature field. 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 x509ParseRsaPssSaltLength (const uint8_t *data, size_t length, X509RsaPssParameters *rsaPssParams)
 Parse RSASSA-PSS salt length. 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 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 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 x509ParseDsaParameters (const uint8_t *data, size_t length, X509DsaParameters *dsaParams)
 Parse DSA domain parameters. More...
 
error_t x509ParseDsaPublicKey (const uint8_t *data, size_t length, X509DsaPublicKey *dsaPublicKey)
 Parse DSAPublicKey structure. More...
 
error_t x509ParseEcParameters (const uint8_t *data, size_t length, X509EcParameters *ecParams)
 Parse ECParameters structure. More...
 
error_t x509ParseEcPublicKey (const uint8_t *data, size_t length, X509EcPublicKey *ecPublicKey)
 Parse ECPublicKey structure. 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 x509ParseExtensions (const uint8_t *data, size_t length, size_t *totalLength, X509Extensions *extensions)
 Parse Extensions structure. More...
 
error_t x509ParseBasicConstraints (const uint8_t *data, size_t length, X509BasicConstraints *basicConstraints)
 Parse BasicConstraints extension. More...
 
error_t x509ParseNameConstraints (const uint8_t *data, size_t length, X509NameConstraints *nameConstraints)
 Parse NameConstraints extension. More...
 
error_t x509ParsePolicyConstraints (const uint8_t *data, size_t length)
 Parse PolicyConstraints extension. More...
 
error_t x509ParsePolicyMappings (const uint8_t *data, size_t length)
 Parse PolicyMappings extension. More...
 
error_t x509ParseInhibitAnyPolicy (const uint8_t *data, size_t length)
 Parse InhibitAnyPolicy extension. More...
 
error_t x509ParseKeyUsage (const uint8_t *data, size_t length, uint16_t *keyUsage)
 Parse KeyUsage extension. More...
 
error_t x509ParseExtendedKeyUsage (const uint8_t *data, size_t length, uint8_t *extKeyUsage)
 Parse ExtendedKeyUsage extension. More...
 
error_t x509ParseSubjectAltName (const uint8_t *data, size_t length, X509SubjectAltName *subjectAltName)
 Parse SubjectAltName extension. 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 x509ParseGeneralName (const uint8_t *data, size_t length, size_t *totalLength, X509GeneralName *generalName)
 Parse GeneralName field. More...
 
error_t x509ParseSubjectKeyId (const uint8_t *data, size_t length, X509SubjectKeyId *subjectKeyId)
 Parse SubjectKeyIdentifier extension. More...
 
error_t x509ParseAuthorityKeyId (const uint8_t *data, size_t length, X509AuthorityKeyId *authorityKeyId)
 Parse AuthorityKeyIdentifier extension. More...
 
error_t x509ParseNsCertType (const uint8_t *data, size_t length, uint8_t *nsCertType)
 Parse NetscapeCertType extension. More...
 
error_t x509ParseSignatureAlgo (const uint8_t *data, size_t length, size_t *totalLength, X509SignatureAlgoId *signatureAlgo)
 Parse SignatureAlgorithm structure. More...
 
error_t x509ParseSignatureValue (const uint8_t *data, size_t length, size_t *totalLength, X509SignatureValue *signatureValue)
 Parse SignatureValue field. More...
 

Detailed Description

X.509 certificate parsing.

License

Copyright (C) 2010-2018 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.0

Definition in file x509_cert_parse.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL

Definition at line 30 of file x509_cert_parse.c.

Function Documentation

◆ x509ParseAlgorithmIdentifier()

error_t x509ParseAlgorithmIdentifier ( const uint8_t *  data,
size_t  length,
size_t *  totalLength,
X509SubjectPublicKeyInfo subjectPublicKeyInfo 
)

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]subjectPublicKeyInfoInformation resulting from the parsing process
Returns
Error code

Definition at line 1207 of file x509_cert_parse.c.

◆ x509ParseAuthorityKeyId()

error_t x509ParseAuthorityKeyId ( const uint8_t *  data,
size_t  length,
X509AuthorityKeyId authorityKeyId 
)

Parse AuthorityKeyIdentifier extension.

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

Definition at line 2642 of file x509_cert_parse.c.

◆ x509ParseBasicConstraints()

error_t x509ParseBasicConstraints ( const uint8_t *  data,
size_t  length,
X509BasicConstraints basicConstraints 
)

Parse BasicConstraints extension.

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

Definition at line 1980 of file x509_cert_parse.c.

◆ x509ParseCertificate()

error_t x509ParseCertificate ( const uint8_t *  data,
size_t  length,
X509CertificateInfo certInfo 
)

Parse a X.509 certificate.

Parameters
[in]dataPointer to the X.509 certificate to parse
[in]lengthLength of the X.509 certificate
[out]certInfoInformation resulting from the parsing process
Returns
Error code

Definition at line 60 of file x509_cert_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 1400 of file x509_cert_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 1493 of file x509_cert_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 1536 of file x509_cert_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 1582 of file x509_cert_parse.c.

◆ x509ParseExtendedKeyUsage()

error_t x509ParseExtendedKeyUsage ( const uint8_t *  data,
size_t  length,
uint8_t *  extKeyUsage 
)

Parse ExtendedKeyUsage extension.

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

Definition at line 2302 of file x509_cert_parse.c.

◆ x509ParseExtensions()

error_t x509ParseExtensions ( const uint8_t *  data,
size_t  length,
size_t *  totalLength,
X509Extensions extensions 
)

Parse Extensions 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]extensionsInformation resulting from the parsing process
Returns
Error code

Definition at line 1723 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]generalNameInformation resulting from the parsing process
Returns
Error code

Definition at line 2558 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]generalNameInformation resulting from the parsing process
Returns
Error code

Definition at line 2525 of file x509_cert_parse.c.

◆ x509ParseGeneralSubtrees()

error_t x509ParseGeneralSubtrees ( const uint8_t *  data,
size_t  length 
)

Parse GeneralSubtrees field.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
Returns
Error code

Definition at line 2491 of file x509_cert_parse.c.

◆ x509ParseInhibitAnyPolicy()

error_t x509ParseInhibitAnyPolicy ( const uint8_t *  data,
size_t  length 
)

Parse InhibitAnyPolicy extension.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
Returns
Error code

Definition at line 2219 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
Returns
Error code

Definition at line 1616 of file x509_cert_parse.c.

◆ x509ParseKeyUsage()

error_t x509ParseKeyUsage ( const uint8_t *  data,
size_t  length,
uint16_t *  keyUsage 
)

Parse KeyUsage extension.

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

Definition at line 2237 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]nameInformation resulting from the parsing process
Returns
Error code

Definition at line 637 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]nameAttributeInformation resulting from the parsing process
Returns
Error code

Definition at line 804 of file x509_cert_parse.c.

◆ x509ParseNameConstraints()

error_t x509ParseNameConstraints ( const uint8_t *  data,
size_t  length,
X509NameConstraints nameConstraints 
)

Parse NameConstraints extension.

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

Definition at line 2067 of file x509_cert_parse.c.

◆ x509ParseNsCertType()

error_t x509ParseNsCertType ( const uint8_t *  data,
size_t  length,
uint8_t *  nsCertType 
)

Parse NetscapeCertType extension.

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

Definition at line 2700 of file x509_cert_parse.c.

◆ x509ParsePolicyConstraints()

error_t x509ParsePolicyConstraints ( const uint8_t *  data,
size_t  length 
)

Parse PolicyConstraints extension.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
Returns
Error code

Definition at line 2158 of file x509_cert_parse.c.

◆ x509ParsePolicyMappings()

error_t x509ParsePolicyMappings ( const uint8_t *  data,
size_t  length 
)

Parse PolicyMappings extension.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
Returns
Error code

Definition at line 2189 of file x509_cert_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 547 of file x509_cert_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 472 of file x509_cert_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 598 of file x509_cert_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 1327 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]serialNumberInformation resulting from the parsing process
Returns
Error code

Definition at line 352 of file x509_cert_parse.c.

◆ x509ParseSignature()

error_t x509ParseSignature ( const uint8_t *  data,
size_t  length,
size_t *  totalLength,
X509SignatureAlgoId signature 
)

Parse Signature field.

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]signatureInformation resulting from the parsing process
Returns
Error code

Definition at line 401 of file x509_cert_parse.c.

◆ x509ParseSignatureAlgo()

error_t x509ParseSignatureAlgo ( const uint8_t *  data,
size_t  length,
size_t *  totalLength,
X509SignatureAlgoId signatureAlgo 
)

Parse SignatureAlgorithm 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]signatureAlgoInformation resulting from the parsing process
Returns
Error code

Definition at line 2751 of file x509_cert_parse.c.

◆ x509ParseSignatureValue()

error_t x509ParseSignatureValue ( const uint8_t *  data,
size_t  length,
size_t *  totalLength,
X509SignatureValue signatureValue 
)

Parse SignatureValue field.

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]signatureValueInformation resulting from the parsing process
Returns
Error code

Definition at line 2796 of file x509_cert_parse.c.

◆ x509ParseSubjectAltName()

error_t x509ParseSubjectAltName ( const uint8_t *  data,
size_t  length,
X509SubjectAltName subjectAltName 
)

Parse SubjectAltName extension.

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

Definition at line 2422 of file x509_cert_parse.c.

◆ x509ParseSubjectKeyId()

error_t x509ParseSubjectKeyId ( const uint8_t *  data,
size_t  length,
X509SubjectKeyId subjectKeyId 
)

Parse SubjectKeyIdentifier extension.

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

Definition at line 2603 of file x509_cert_parse.c.

◆ x509ParseSubjectPublicKeyInfo()

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

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]subjectPublicKeyInfoInformation resulting from the parsing process
Returns
Error code

Definition at line 1065 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
Returns
Error code

Definition at line 1669 of file x509_cert_parse.c.

◆ x509ParseTbsCertificate()

error_t x509ParseTbsCertificate ( const uint8_t *  data,
size_t  length,
size_t *  totalLength,
X509CertificateInfo certInfo 
)

Parse TBSCertificate 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]certInfoInformation resulting from the parsing process
Returns
Error code

Definition at line 128 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]dateTimedate resulting from the parsing process
Returns
Error code

Definition at line 933 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]validityInformation resulting from the parsing process
Returns
Error code

Definition at line 880 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]versionInformation resulting from the parsing process
Returns
Error code

Definition at line 291 of file x509_cert_parse.c.