Webserver+3d print
cyclone_crypto/x509.h@0:8918a71cdbe9, 2017-02-04 (annotated)
- Committer:
- Sergunb
- Date:
- Sat Feb 04 18:15:49 2017 +0000
- Revision:
- 0:8918a71cdbe9
nothing else
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Sergunb | 0:8918a71cdbe9 | 1 | /** |
Sergunb | 0:8918a71cdbe9 | 2 | * @file x509.h |
Sergunb | 0:8918a71cdbe9 | 3 | * @brief X.509 certificate parsing and verification |
Sergunb | 0:8918a71cdbe9 | 4 | * |
Sergunb | 0:8918a71cdbe9 | 5 | * @section License |
Sergunb | 0:8918a71cdbe9 | 6 | * |
Sergunb | 0:8918a71cdbe9 | 7 | * Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved. |
Sergunb | 0:8918a71cdbe9 | 8 | * |
Sergunb | 0:8918a71cdbe9 | 9 | * This file is part of CycloneCrypto Open. |
Sergunb | 0:8918a71cdbe9 | 10 | * |
Sergunb | 0:8918a71cdbe9 | 11 | * This program is free software; you can redistribute it and/or |
Sergunb | 0:8918a71cdbe9 | 12 | * modify it under the terms of the GNU General Public License |
Sergunb | 0:8918a71cdbe9 | 13 | * as published by the Free Software Foundation; either version 2 |
Sergunb | 0:8918a71cdbe9 | 14 | * of the License, or (at your option) any later version. |
Sergunb | 0:8918a71cdbe9 | 15 | * |
Sergunb | 0:8918a71cdbe9 | 16 | * This program is distributed in the hope that it will be useful, |
Sergunb | 0:8918a71cdbe9 | 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
Sergunb | 0:8918a71cdbe9 | 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Sergunb | 0:8918a71cdbe9 | 19 | * GNU General Public License for more details. |
Sergunb | 0:8918a71cdbe9 | 20 | * |
Sergunb | 0:8918a71cdbe9 | 21 | * You should have received a copy of the GNU General Public License |
Sergunb | 0:8918a71cdbe9 | 22 | * along with this program; if not, write to the Free Software Foundation, |
Sergunb | 0:8918a71cdbe9 | 23 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
Sergunb | 0:8918a71cdbe9 | 24 | * |
Sergunb | 0:8918a71cdbe9 | 25 | * @author Oryx Embedded SARL (www.oryx-embedded.com) |
Sergunb | 0:8918a71cdbe9 | 26 | * @version 1.7.6 |
Sergunb | 0:8918a71cdbe9 | 27 | **/ |
Sergunb | 0:8918a71cdbe9 | 28 | |
Sergunb | 0:8918a71cdbe9 | 29 | #ifndef _X509_H |
Sergunb | 0:8918a71cdbe9 | 30 | #define _X509_H |
Sergunb | 0:8918a71cdbe9 | 31 | |
Sergunb | 0:8918a71cdbe9 | 32 | //Dependencies |
Sergunb | 0:8918a71cdbe9 | 33 | #include "crypto.h" |
Sergunb | 0:8918a71cdbe9 | 34 | #include "date_time.h" |
Sergunb | 0:8918a71cdbe9 | 35 | #include "rsa.h" |
Sergunb | 0:8918a71cdbe9 | 36 | #include "dsa.h" |
Sergunb | 0:8918a71cdbe9 | 37 | #include "ec.h" |
Sergunb | 0:8918a71cdbe9 | 38 | |
Sergunb | 0:8918a71cdbe9 | 39 | |
Sergunb | 0:8918a71cdbe9 | 40 | /** |
Sergunb | 0:8918a71cdbe9 | 41 | * @brief X.509 versions |
Sergunb | 0:8918a71cdbe9 | 42 | **/ |
Sergunb | 0:8918a71cdbe9 | 43 | |
Sergunb | 0:8918a71cdbe9 | 44 | typedef enum |
Sergunb | 0:8918a71cdbe9 | 45 | { |
Sergunb | 0:8918a71cdbe9 | 46 | X509_VERSION_1 = 0x00, |
Sergunb | 0:8918a71cdbe9 | 47 | X509_VERSION_2 = 0x01, |
Sergunb | 0:8918a71cdbe9 | 48 | X509_VERSION_3 = 0x02, |
Sergunb | 0:8918a71cdbe9 | 49 | } X509Version; |
Sergunb | 0:8918a71cdbe9 | 50 | |
Sergunb | 0:8918a71cdbe9 | 51 | |
Sergunb | 0:8918a71cdbe9 | 52 | /** |
Sergunb | 0:8918a71cdbe9 | 53 | * @brief Issuer or subject name |
Sergunb | 0:8918a71cdbe9 | 54 | **/ |
Sergunb | 0:8918a71cdbe9 | 55 | |
Sergunb | 0:8918a71cdbe9 | 56 | typedef struct |
Sergunb | 0:8918a71cdbe9 | 57 | { |
Sergunb | 0:8918a71cdbe9 | 58 | const uint8_t *rawData; |
Sergunb | 0:8918a71cdbe9 | 59 | size_t rawDataLen; |
Sergunb | 0:8918a71cdbe9 | 60 | const char_t *commonName; |
Sergunb | 0:8918a71cdbe9 | 61 | size_t commonNameLen; |
Sergunb | 0:8918a71cdbe9 | 62 | const char_t *surname; |
Sergunb | 0:8918a71cdbe9 | 63 | size_t surnameLen; |
Sergunb | 0:8918a71cdbe9 | 64 | const char_t *serialNumber; |
Sergunb | 0:8918a71cdbe9 | 65 | size_t serialNumberLen; |
Sergunb | 0:8918a71cdbe9 | 66 | const char_t *countryName; |
Sergunb | 0:8918a71cdbe9 | 67 | size_t countryNameLen; |
Sergunb | 0:8918a71cdbe9 | 68 | const char_t *localityName; |
Sergunb | 0:8918a71cdbe9 | 69 | size_t localityNameLen; |
Sergunb | 0:8918a71cdbe9 | 70 | const char_t *stateOrProvinceName; |
Sergunb | 0:8918a71cdbe9 | 71 | size_t stateOrProvinceNameLen; |
Sergunb | 0:8918a71cdbe9 | 72 | const char_t *organizationName; |
Sergunb | 0:8918a71cdbe9 | 73 | size_t organizationNameLen; |
Sergunb | 0:8918a71cdbe9 | 74 | const char_t *organizationalUnitName; |
Sergunb | 0:8918a71cdbe9 | 75 | size_t organizationalUnitNameLen; |
Sergunb | 0:8918a71cdbe9 | 76 | const char_t *title; |
Sergunb | 0:8918a71cdbe9 | 77 | size_t titleLen; |
Sergunb | 0:8918a71cdbe9 | 78 | const char_t *name; |
Sergunb | 0:8918a71cdbe9 | 79 | size_t nameLen; |
Sergunb | 0:8918a71cdbe9 | 80 | const char_t *givenName; |
Sergunb | 0:8918a71cdbe9 | 81 | size_t givenNameLen; |
Sergunb | 0:8918a71cdbe9 | 82 | const char_t *initials; |
Sergunb | 0:8918a71cdbe9 | 83 | size_t initialsLen; |
Sergunb | 0:8918a71cdbe9 | 84 | const char_t *generationQualifier; |
Sergunb | 0:8918a71cdbe9 | 85 | size_t generationQualifierLen; |
Sergunb | 0:8918a71cdbe9 | 86 | const char_t *dnQualifier; |
Sergunb | 0:8918a71cdbe9 | 87 | size_t dnQualifierLen; |
Sergunb | 0:8918a71cdbe9 | 88 | const char_t *pseudonym; |
Sergunb | 0:8918a71cdbe9 | 89 | size_t pseudonymLen; |
Sergunb | 0:8918a71cdbe9 | 90 | } X509Name; |
Sergunb | 0:8918a71cdbe9 | 91 | |
Sergunb | 0:8918a71cdbe9 | 92 | |
Sergunb | 0:8918a71cdbe9 | 93 | /** |
Sergunb | 0:8918a71cdbe9 | 94 | * @brief Validity |
Sergunb | 0:8918a71cdbe9 | 95 | **/ |
Sergunb | 0:8918a71cdbe9 | 96 | |
Sergunb | 0:8918a71cdbe9 | 97 | typedef struct |
Sergunb | 0:8918a71cdbe9 | 98 | { |
Sergunb | 0:8918a71cdbe9 | 99 | DateTime notBefore; |
Sergunb | 0:8918a71cdbe9 | 100 | DateTime notAfter; |
Sergunb | 0:8918a71cdbe9 | 101 | } X509Validity; |
Sergunb | 0:8918a71cdbe9 | 102 | |
Sergunb | 0:8918a71cdbe9 | 103 | |
Sergunb | 0:8918a71cdbe9 | 104 | /** |
Sergunb | 0:8918a71cdbe9 | 105 | * @brief RSA public key |
Sergunb | 0:8918a71cdbe9 | 106 | **/ |
Sergunb | 0:8918a71cdbe9 | 107 | |
Sergunb | 0:8918a71cdbe9 | 108 | typedef struct |
Sergunb | 0:8918a71cdbe9 | 109 | { |
Sergunb | 0:8918a71cdbe9 | 110 | const uint8_t *n; |
Sergunb | 0:8918a71cdbe9 | 111 | size_t nLen; |
Sergunb | 0:8918a71cdbe9 | 112 | const uint8_t *e; |
Sergunb | 0:8918a71cdbe9 | 113 | size_t eLen; |
Sergunb | 0:8918a71cdbe9 | 114 | } X509RsaPublicKey; |
Sergunb | 0:8918a71cdbe9 | 115 | |
Sergunb | 0:8918a71cdbe9 | 116 | |
Sergunb | 0:8918a71cdbe9 | 117 | /** |
Sergunb | 0:8918a71cdbe9 | 118 | * @brief DSA domain parameters |
Sergunb | 0:8918a71cdbe9 | 119 | **/ |
Sergunb | 0:8918a71cdbe9 | 120 | |
Sergunb | 0:8918a71cdbe9 | 121 | typedef struct |
Sergunb | 0:8918a71cdbe9 | 122 | { |
Sergunb | 0:8918a71cdbe9 | 123 | const uint8_t *p; |
Sergunb | 0:8918a71cdbe9 | 124 | size_t pLen; |
Sergunb | 0:8918a71cdbe9 | 125 | const uint8_t *q; |
Sergunb | 0:8918a71cdbe9 | 126 | size_t qLen; |
Sergunb | 0:8918a71cdbe9 | 127 | const uint8_t *g; |
Sergunb | 0:8918a71cdbe9 | 128 | size_t gLen; |
Sergunb | 0:8918a71cdbe9 | 129 | } X509DsaParameters; |
Sergunb | 0:8918a71cdbe9 | 130 | |
Sergunb | 0:8918a71cdbe9 | 131 | |
Sergunb | 0:8918a71cdbe9 | 132 | /** |
Sergunb | 0:8918a71cdbe9 | 133 | * @brief DSA public key |
Sergunb | 0:8918a71cdbe9 | 134 | **/ |
Sergunb | 0:8918a71cdbe9 | 135 | |
Sergunb | 0:8918a71cdbe9 | 136 | typedef struct |
Sergunb | 0:8918a71cdbe9 | 137 | { |
Sergunb | 0:8918a71cdbe9 | 138 | const uint8_t *y; |
Sergunb | 0:8918a71cdbe9 | 139 | size_t yLen; |
Sergunb | 0:8918a71cdbe9 | 140 | } X509DsaPublicKey; |
Sergunb | 0:8918a71cdbe9 | 141 | |
Sergunb | 0:8918a71cdbe9 | 142 | |
Sergunb | 0:8918a71cdbe9 | 143 | /** |
Sergunb | 0:8918a71cdbe9 | 144 | * @brief EC parameters |
Sergunb | 0:8918a71cdbe9 | 145 | **/ |
Sergunb | 0:8918a71cdbe9 | 146 | |
Sergunb | 0:8918a71cdbe9 | 147 | typedef struct |
Sergunb | 0:8918a71cdbe9 | 148 | { |
Sergunb | 0:8918a71cdbe9 | 149 | const uint8_t *namedCurve; |
Sergunb | 0:8918a71cdbe9 | 150 | size_t namedCurveLen; |
Sergunb | 0:8918a71cdbe9 | 151 | } X509EcParameters; |
Sergunb | 0:8918a71cdbe9 | 152 | |
Sergunb | 0:8918a71cdbe9 | 153 | |
Sergunb | 0:8918a71cdbe9 | 154 | /** |
Sergunb | 0:8918a71cdbe9 | 155 | * @brief EC public key |
Sergunb | 0:8918a71cdbe9 | 156 | **/ |
Sergunb | 0:8918a71cdbe9 | 157 | |
Sergunb | 0:8918a71cdbe9 | 158 | typedef struct |
Sergunb | 0:8918a71cdbe9 | 159 | { |
Sergunb | 0:8918a71cdbe9 | 160 | const uint8_t *q; |
Sergunb | 0:8918a71cdbe9 | 161 | size_t qLen; |
Sergunb | 0:8918a71cdbe9 | 162 | } X509EcPublicKey; |
Sergunb | 0:8918a71cdbe9 | 163 | |
Sergunb | 0:8918a71cdbe9 | 164 | |
Sergunb | 0:8918a71cdbe9 | 165 | /** |
Sergunb | 0:8918a71cdbe9 | 166 | * @brief Subject public key info |
Sergunb | 0:8918a71cdbe9 | 167 | **/ |
Sergunb | 0:8918a71cdbe9 | 168 | |
Sergunb | 0:8918a71cdbe9 | 169 | typedef struct |
Sergunb | 0:8918a71cdbe9 | 170 | { |
Sergunb | 0:8918a71cdbe9 | 171 | const uint8_t *oid; |
Sergunb | 0:8918a71cdbe9 | 172 | size_t oidLen; |
Sergunb | 0:8918a71cdbe9 | 173 | #if (RSA_SUPPORT == ENABLED) |
Sergunb | 0:8918a71cdbe9 | 174 | X509RsaPublicKey rsaPublicKey; |
Sergunb | 0:8918a71cdbe9 | 175 | #endif |
Sergunb | 0:8918a71cdbe9 | 176 | #if (DSA_SUPPORT == ENABLED) |
Sergunb | 0:8918a71cdbe9 | 177 | X509DsaParameters dsaParams; |
Sergunb | 0:8918a71cdbe9 | 178 | X509DsaPublicKey dsaPublicKey; |
Sergunb | 0:8918a71cdbe9 | 179 | #endif |
Sergunb | 0:8918a71cdbe9 | 180 | #if (EC_SUPPORT == ENABLED) |
Sergunb | 0:8918a71cdbe9 | 181 | X509EcParameters ecParams; |
Sergunb | 0:8918a71cdbe9 | 182 | X509EcPublicKey ecPublicKey; |
Sergunb | 0:8918a71cdbe9 | 183 | #endif |
Sergunb | 0:8918a71cdbe9 | 184 | } X509SubjectPublicKeyInfo; |
Sergunb | 0:8918a71cdbe9 | 185 | |
Sergunb | 0:8918a71cdbe9 | 186 | |
Sergunb | 0:8918a71cdbe9 | 187 | /** |
Sergunb | 0:8918a71cdbe9 | 188 | * @brief Basic constraints |
Sergunb | 0:8918a71cdbe9 | 189 | **/ |
Sergunb | 0:8918a71cdbe9 | 190 | |
Sergunb | 0:8918a71cdbe9 | 191 | typedef struct |
Sergunb | 0:8918a71cdbe9 | 192 | { |
Sergunb | 0:8918a71cdbe9 | 193 | bool_t ca; |
Sergunb | 0:8918a71cdbe9 | 194 | uint_t pathLenConstraint; |
Sergunb | 0:8918a71cdbe9 | 195 | } X509BasicContraints; |
Sergunb | 0:8918a71cdbe9 | 196 | |
Sergunb | 0:8918a71cdbe9 | 197 | |
Sergunb | 0:8918a71cdbe9 | 198 | /** |
Sergunb | 0:8918a71cdbe9 | 199 | * @brief X.509 certificate |
Sergunb | 0:8918a71cdbe9 | 200 | **/ |
Sergunb | 0:8918a71cdbe9 | 201 | |
Sergunb | 0:8918a71cdbe9 | 202 | typedef struct |
Sergunb | 0:8918a71cdbe9 | 203 | { |
Sergunb | 0:8918a71cdbe9 | 204 | const uint8_t *tbsCertificate; |
Sergunb | 0:8918a71cdbe9 | 205 | size_t tbsCertificateLen; |
Sergunb | 0:8918a71cdbe9 | 206 | uint8_t version; |
Sergunb | 0:8918a71cdbe9 | 207 | const uint8_t *serialNumber; |
Sergunb | 0:8918a71cdbe9 | 208 | size_t serialNumberLen; |
Sergunb | 0:8918a71cdbe9 | 209 | X509Name issuer; |
Sergunb | 0:8918a71cdbe9 | 210 | X509Validity validity; |
Sergunb | 0:8918a71cdbe9 | 211 | X509Name subject; |
Sergunb | 0:8918a71cdbe9 | 212 | X509SubjectPublicKeyInfo subjectPublicKeyInfo; |
Sergunb | 0:8918a71cdbe9 | 213 | X509BasicContraints basicConstraints; |
Sergunb | 0:8918a71cdbe9 | 214 | const uint8_t *signatureAlgo; |
Sergunb | 0:8918a71cdbe9 | 215 | size_t signatureAlgoLen; |
Sergunb | 0:8918a71cdbe9 | 216 | const uint8_t *signatureValue; |
Sergunb | 0:8918a71cdbe9 | 217 | size_t signatureValueLen; |
Sergunb | 0:8918a71cdbe9 | 218 | } X509CertificateInfo; |
Sergunb | 0:8918a71cdbe9 | 219 | |
Sergunb | 0:8918a71cdbe9 | 220 | |
Sergunb | 0:8918a71cdbe9 | 221 | //X.509 related constants |
Sergunb | 0:8918a71cdbe9 | 222 | extern const uint8_t X509_COMMON_NAME_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 223 | extern const uint8_t X509_SURNAME_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 224 | extern const uint8_t X509_SERIAL_NUMBER_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 225 | extern const uint8_t X509_COUNTRY_NAME_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 226 | extern const uint8_t X509_LOCALITY_NAME_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 227 | extern const uint8_t X509_STATE_OR_PROVINCE_NAME_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 228 | extern const uint8_t X509_ORGANIZATION_NAME_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 229 | extern const uint8_t X509_ORGANIZATIONAL_UNIT_NAME_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 230 | extern const uint8_t X509_TITLE_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 231 | extern const uint8_t X509_NAME_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 232 | extern const uint8_t X509_GIVEN_NAME_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 233 | extern const uint8_t X509_INITIALS_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 234 | extern const uint8_t X509_GENERATION_QUALIFIER_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 235 | extern const uint8_t X509_DN_QUALIFIER_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 236 | extern const uint8_t X509_PSEUDONYM_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 237 | |
Sergunb | 0:8918a71cdbe9 | 238 | extern const uint8_t X509_SUBJECT_DIRECTORY_ATTR_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 239 | extern const uint8_t X509_SUBJECT_KEY_ID_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 240 | extern const uint8_t X509_KEY_USAGE_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 241 | extern const uint8_t X509_SUBJECT_ALT_NAME_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 242 | extern const uint8_t X509_ISSUER_ALT_NAME_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 243 | extern const uint8_t X509_BASIC_CONSTRAINTS_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 244 | extern const uint8_t X509_NAME_CONSTRAINTS_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 245 | extern const uint8_t X509_CRL_DISTR_POINTS_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 246 | extern const uint8_t X509_CERTIFICATE_POLICIES_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 247 | extern const uint8_t X509_POLICY_MAPPINGS_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 248 | extern const uint8_t X509_AUTHORITY_KEY_ID_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 249 | extern const uint8_t X509_POLICY_CONSTRAINTS_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 250 | extern const uint8_t X509_EXTENDED_KEY_USAGE_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 251 | extern const uint8_t X509_FRESHEST_CRL_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 252 | extern const uint8_t X509_INHIBIT_ANY_POLICY_OID[3]; |
Sergunb | 0:8918a71cdbe9 | 253 | |
Sergunb | 0:8918a71cdbe9 | 254 | //X.509 related functions |
Sergunb | 0:8918a71cdbe9 | 255 | error_t x509ParseCertificate(const uint8_t *data, size_t length, |
Sergunb | 0:8918a71cdbe9 | 256 | X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 257 | |
Sergunb | 0:8918a71cdbe9 | 258 | error_t x509ParseTbsCertificate(const uint8_t *data, size_t length, |
Sergunb | 0:8918a71cdbe9 | 259 | size_t *totalLength, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 260 | |
Sergunb | 0:8918a71cdbe9 | 261 | error_t x509ParseVersion(const uint8_t *data, size_t length, |
Sergunb | 0:8918a71cdbe9 | 262 | size_t *totalLength, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 263 | |
Sergunb | 0:8918a71cdbe9 | 264 | error_t x509ParseSerialNumber(const uint8_t *data, size_t length, |
Sergunb | 0:8918a71cdbe9 | 265 | size_t *totalLength, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 266 | |
Sergunb | 0:8918a71cdbe9 | 267 | error_t x509ParseSignature(const uint8_t *data, size_t length, |
Sergunb | 0:8918a71cdbe9 | 268 | size_t *totalLength, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 269 | |
Sergunb | 0:8918a71cdbe9 | 270 | error_t x509ParseName(const uint8_t *data, size_t length, |
Sergunb | 0:8918a71cdbe9 | 271 | size_t *totalLength, X509Name *name); |
Sergunb | 0:8918a71cdbe9 | 272 | |
Sergunb | 0:8918a71cdbe9 | 273 | error_t x509ParseValidity(const uint8_t *data, size_t length, |
Sergunb | 0:8918a71cdbe9 | 274 | size_t *totalLength, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 275 | |
Sergunb | 0:8918a71cdbe9 | 276 | error_t x509ParseTime(const uint8_t *data, size_t length, |
Sergunb | 0:8918a71cdbe9 | 277 | size_t *totalLength, DateTime *dateTime); |
Sergunb | 0:8918a71cdbe9 | 278 | |
Sergunb | 0:8918a71cdbe9 | 279 | error_t x509ParseSubjectPublicKeyInfo(const uint8_t *data, size_t length, |
Sergunb | 0:8918a71cdbe9 | 280 | size_t *totalLength, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 281 | |
Sergunb | 0:8918a71cdbe9 | 282 | error_t x509ParseAlgorithmIdentifier(const uint8_t *data, size_t length, |
Sergunb | 0:8918a71cdbe9 | 283 | size_t *totalLength, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 284 | |
Sergunb | 0:8918a71cdbe9 | 285 | error_t x509ParseRsaPublicKey(const uint8_t *data, |
Sergunb | 0:8918a71cdbe9 | 286 | size_t length, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 287 | |
Sergunb | 0:8918a71cdbe9 | 288 | error_t x509ParseDsaParameters(const uint8_t *data, |
Sergunb | 0:8918a71cdbe9 | 289 | size_t length, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 290 | |
Sergunb | 0:8918a71cdbe9 | 291 | error_t x509ParseDsaPublicKey(const uint8_t *data, |
Sergunb | 0:8918a71cdbe9 | 292 | size_t length, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 293 | |
Sergunb | 0:8918a71cdbe9 | 294 | error_t x509ParseEcParameters(const uint8_t *data, |
Sergunb | 0:8918a71cdbe9 | 295 | size_t length, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 296 | |
Sergunb | 0:8918a71cdbe9 | 297 | error_t x509ParseEcPublicKey(const uint8_t *data, |
Sergunb | 0:8918a71cdbe9 | 298 | size_t length, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 299 | |
Sergunb | 0:8918a71cdbe9 | 300 | error_t x509ParseIssuerUniqueId(const uint8_t *data, size_t length, |
Sergunb | 0:8918a71cdbe9 | 301 | size_t *totalLength, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 302 | |
Sergunb | 0:8918a71cdbe9 | 303 | error_t x509ParseSubjectUniqueId(const uint8_t *data, size_t length, |
Sergunb | 0:8918a71cdbe9 | 304 | size_t *totalLength, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 305 | |
Sergunb | 0:8918a71cdbe9 | 306 | error_t x509ParseExtensions(const uint8_t *data, size_t length, |
Sergunb | 0:8918a71cdbe9 | 307 | size_t *totalLength, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 308 | |
Sergunb | 0:8918a71cdbe9 | 309 | error_t x509ParseBasicConstraints(const uint8_t *data, |
Sergunb | 0:8918a71cdbe9 | 310 | size_t length, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 311 | |
Sergunb | 0:8918a71cdbe9 | 312 | error_t x509ParseSignatureAlgo(const uint8_t *data, size_t length, |
Sergunb | 0:8918a71cdbe9 | 313 | size_t *totalLength, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 314 | |
Sergunb | 0:8918a71cdbe9 | 315 | error_t x509ParseSignatureValue(const uint8_t *data, size_t length, |
Sergunb | 0:8918a71cdbe9 | 316 | size_t *totalLength, X509CertificateInfo *certInfo); |
Sergunb | 0:8918a71cdbe9 | 317 | |
Sergunb | 0:8918a71cdbe9 | 318 | error_t x509ParseInt(const uint8_t *data, size_t length, uint_t *value); |
Sergunb | 0:8918a71cdbe9 | 319 | |
Sergunb | 0:8918a71cdbe9 | 320 | error_t x509ReadRsaPublicKey(const X509CertificateInfo *certInfo, RsaPublicKey *key); |
Sergunb | 0:8918a71cdbe9 | 321 | error_t x509ReadDsaPublicKey(const X509CertificateInfo *certInfo, DsaPublicKey *key); |
Sergunb | 0:8918a71cdbe9 | 322 | |
Sergunb | 0:8918a71cdbe9 | 323 | error_t x509ValidateCertificate(const X509CertificateInfo *certInfo, |
Sergunb | 0:8918a71cdbe9 | 324 | const X509CertificateInfo *issuerCertInfo); |
Sergunb | 0:8918a71cdbe9 | 325 | |
Sergunb | 0:8918a71cdbe9 | 326 | #endif |
Sergunb | 0:8918a71cdbe9 | 327 |