x509_common.h File Reference

X.509 common definitions. More...

#include "core/crypto.h"
#include "pkc/rsa.h"
#include "pkc/dsa.h"
#include "ecc/ecdsa.h"
#include "date_time.h"

Go to the source code of this file.

Data Structures

struct  X509SerialNumber
 Serial number. More...
 
struct  X509Name
 Issuer or subject name. More...
 
struct  X509NameAttribute
 Name attribute. More...
 
struct  X509Validity
 Validity. More...
 
struct  X509RsaPublicKey
 RSA public key. More...
 
struct  X509DsaParameters
 DSA domain parameters. More...
 
struct  X509DsaPublicKey
 DSA public key. More...
 
struct  X509EcParameters
 EC parameters. More...
 
struct  X509EcPublicKey
 EC public key. More...
 
struct  X509SubjectPublicKeyInfo
 Subject public key info. More...
 
struct  X509BasicConstraints
 Basic constraints. More...
 
struct  X509NameConstraints
 Name constraints. More...
 
struct  X509GeneralName
 General name. More...
 
struct  X509SubjectAltName
 Subject alternative name. More...
 
struct  X509SubjectKeyId
 Subject key identifier. More...
 
struct  X509AuthorityKeyId
 Authority key identifier. More...
 
struct  X509Extensions
 Extensions. More...
 
struct  X509RsaPssParameters
 RSASSA-PSS parameters. More...
 
struct  X509SignatureAlgoId
 Signature algorithm identifier. More...
 
struct  X509SignatureValue
 Signature value. More...
 
struct  X509CertificateInfo
 X.509 certificate. More...
 
struct  X509RevokedCertificate
 Revoked certificate. More...
 
struct  X509CrlInfo
 X.509 CRL. More...
 

Macros

#define X509_RSA_SUPPORT   ENABLED
 
#define X509_RSA_PSS_SUPPORT   DISABLED
 
#define X509_DSA_SUPPORT   DISABLED
 
#define X509_ECDSA_SUPPORT   ENABLED
 
#define X509_MD5_SUPPORT   DISABLED
 
#define X509_SHA1_SUPPORT   ENABLED
 
#define X509_SHA224_SUPPORT   DISABLED
 
#define X509_SHA256_SUPPORT   ENABLED
 
#define X509_SHA384_SUPPORT   ENABLED
 
#define X509_SHA512_SUPPORT   ENABLED
 
#define X509_SHA3_224_SUPPORT   DISABLED
 
#define X509_SHA3_256_SUPPORT   DISABLED
 
#define X509_SHA3_384_SUPPORT   DISABLED
 
#define X509_SHA3_512_SUPPORT   DISABLED
 
#define X509_SECP112R1_SUPPORT   DISABLED
 
#define X509_SECP112R2_SUPPORT   DISABLED
 
#define X509_SECP128R1_SUPPORT   DISABLED
 
#define X509_SECP128R2_SUPPORT   DISABLED
 
#define X509_SECP160K1_SUPPORT   DISABLED
 
#define X509_SECP160R1_SUPPORT   DISABLED
 
#define X509_SECP160R2_SUPPORT   DISABLED
 
#define X509_SECP192K1_SUPPORT   DISABLED
 
#define X509_SECP192R1_SUPPORT   ENABLED
 
#define X509_SECP224K1_SUPPORT   DISABLED
 
#define X509_SECP224R1_SUPPORT   ENABLED
 
#define X509_SECP256K1_SUPPORT   DISABLED
 
#define X509_SECP256R1_SUPPORT   ENABLED
 
#define X509_SECP384R1_SUPPORT   ENABLED
 
#define X509_SECP521R1_SUPPORT   ENABLED
 
#define X509_BRAINPOOLP160R1_SUPPORT   DISABLED
 
#define X509_BRAINPOOLP192R1_SUPPORT   DISABLED
 
#define X509_BRAINPOOLP224R1_SUPPORT   DISABLED
 
#define X509_BRAINPOOLP256R1_SUPPORT   DISABLED
 
#define X509_BRAINPOOLP320R1_SUPPORT   DISABLED
 
#define X509_BRAINPOOLP384R1_SUPPORT   DISABLED
 
#define X509_BRAINPOOLP512R1_SUPPORT   DISABLED
 
#define X509_ED25519_SUPPORT   DISABLED
 
#define X509_ED448_SUPPORT   DISABLED
 
#define X509_MIN_RSA_MODULUS_SIZE   1024
 
#define X509_MAX_RSA_MODULUS_SIZE   4096
 
#define X509_MIN_DSA_MODULUS_SIZE   1024
 
#define X509_MAX_DSA_MODULUS_SIZE   4096
 
#define X509_MAX_SUBJECT_ALT_NAMES   4
 

Enumerations

enum  X509Version { X509_VERSION_1 = 0x00, X509_VERSION_2 = 0x01, X509_VERSION_3 = 0x02 }
 X.509 versions. More...
 
enum  X509KeyUsage {
  X509_KEY_USAGE_DIGITAL_SIGNATURE = 0x0001, X509_KEY_USAGE_NON_REPUDIATION = 0x0002, X509_KEY_USAGE_KEY_ENCIPHERMENT = 0x0004, X509_KEY_USAGE_DATA_ENCIPHERMENT = 0x0008,
  X509_KEY_USAGE_KEY_AGREEMENT = 0x0010, X509_KEY_USAGE_KEY_CERT_SIGN = 0x0020, X509_KEY_USAGE_CRL_SIGN = 0x0040, X509_KEY_USAGE_ENCIPHER_ONLY = 0x0080,
  X509_KEY_USAGE_DECIPHER_ONLY = 0x0100
}
 Key usage. More...
 
enum  X509ExtKeyUsage {
  X509_EXT_KEY_USAGE_SERVER_AUTH = 0x01, X509_EXT_KEY_USAGE_CLIENT_AUTH = 0x02, X509_EXT_KEY_USAGE_CODE_SIGNING = 0x04, X509_EXT_KEY_USAGE_EMAIL_PROTECTION = 0x08,
  X509_EXT_KEY_USAGE_TIME_STAMPING = 0x10, X509_EXT_KEY_USAGE_OCSP_SIGNING = 0x20, X509_EXT_KEY_USAGE_ANY = 0x3F
}
 Extended key usage. More...
 
enum  X509GeneralNameType {
  X509_GENERAL_NAME_TYPE_OTHER = 0, X509_GENERAL_NAME_TYPE_RFC822 = 1, X509_GENERAL_NAME_TYPE_DNS = 2, X509_GENERAL_NAME_TYPE_X400_ADDRESS = 3,
  X509_GENERAL_NAME_TYPE_DIRECTORY = 4, X509_GENERAL_NAME_TYPE_EDI_PARTY = 5, X509_GENERAL_NAME_TYPE_URI = 6, X509_GENERAL_NAME_TYPE_IP_ADDRESS = 7,
  X509_GENERAL_NAME_TYPE_REGISTERED_ID = 8
}
 General name types. More...
 
enum  X509NsCertType { X509_NS_CERT_TYPE_SSL_CLIENT = 0x01, X509_NS_CERT_TYPE_SSL_SERVER = 0x02, X509_NS_CERT_TYPE_SSL_CA = 0x20 }
 Netscape certificate types. More...
 
enum  X509SignatureAlgo {
  X509_SIGN_ALGO_NONE = 0, X509_SIGN_ALGO_RSA = 1, X509_SIGN_ALGO_RSA_PSS = 2, X509_SIGN_ALGO_DSA = 3,
  X509_SIGN_ALGO_ECDSA = 4, X509_SIGN_ALGO_ED25519 = 5, X509_SIGN_ALGO_ED448 = 6
}
 Signature algorithms. More...
 
enum  X509HashAlgo {
  X509_HASH_ALGO_NONE = 0, X509_HASH_ALGO_MD5 = 1, X509_HASH_ALGO_SHA1 = 2, X509_HASH_ALGO_SHA224 = 3,
  X509_HASH_ALGO_SHA256 = 4, X509_HASH_ALGO_SHA384 = 5, X509_HASH_ALGO_SHA512 = 6, X509_HASH_ALGO_SHA3_224 = 7,
  X509_HASH_ALGO_SHA3_256 = 8, X509_HASH_ALGO_SHA3_384 = 9, X509_HASH_ALGO_SHA3_512 = 10
}
 Hash algorithms. More...
 

Functions

error_t x509ReadInt (const uint8_t *data, size_t length, uint_t *value)
 Convert string to integer. More...
 
error_t x509ReadRsaPublicKey (const X509SubjectPublicKeyInfo *subjectPublicKeyInfo, RsaPublicKey *key)
 Read a RSA public key. More...
 
error_t x509ReadDsaPublicKey (const X509SubjectPublicKeyInfo *subjectPublicKeyInfo, DsaPublicKey *key)
 Read a DSA public key. More...
 
bool_t x509IsSignAlgoSupported (X509SignatureAlgo signAlgo)
 Check whether a given signature algorithm is supported. More...
 
bool_t x509IsHashAlgoSupported (X509HashAlgo hashAlgo)
 Check whether a given hash algorithm is supported. More...
 
error_t x509GetSignHashAlgo (const X509SignatureAlgoId *signAlgoId, X509SignatureAlgo *signAlgo, const HashAlgo **hashAlgo)
 Get the signature and hash algorithms that match the specified identifier. More...
 
const EcCurveInfox509GetCurveInfo (const uint8_t *oid, size_t length)
 Get the elliptic curve that matches the specified OID. More...
 

Variables

const uint8_t X509_COMMON_NAME_OID [3]
 
const uint8_t X509_SURNAME_OID [3]
 
const uint8_t X509_SERIAL_NUMBER_OID [3]
 
const uint8_t X509_COUNTRY_NAME_OID [3]
 
const uint8_t X509_LOCALITY_NAME_OID [3]
 
const uint8_t X509_STATE_OR_PROVINCE_NAME_OID [3]
 
const uint8_t X509_ORGANIZATION_NAME_OID [3]
 
const uint8_t X509_ORGANIZATIONAL_UNIT_NAME_OID [3]
 
const uint8_t X509_TITLE_OID [3]
 
const uint8_t X509_NAME_OID [3]
 
const uint8_t X509_GIVEN_NAME_OID [3]
 
const uint8_t X509_INITIALS_OID [3]
 
const uint8_t X509_GENERATION_QUALIFIER_OID [3]
 
const uint8_t X509_DN_QUALIFIER_OID [3]
 
const uint8_t X509_PSEUDONYM_OID [3]
 
const uint8_t X509_SUBJECT_DIRECTORY_ATTR_OID [3]
 
const uint8_t X509_SUBJECT_KEY_ID_OID [3]
 
const uint8_t X509_KEY_USAGE_OID [3]
 
const uint8_t X509_SUBJECT_ALT_NAME_OID [3]
 
const uint8_t X509_ISSUER_ALT_NAME_OID [3]
 
const uint8_t X509_BASIC_CONSTRAINTS_OID [3]
 
const uint8_t X509_NAME_CONSTRAINTS_OID [3]
 
const uint8_t X509_CRL_DISTR_POINTS_OID [3]
 
const uint8_t X509_CERTIFICATE_POLICIES_OID [3]
 
const uint8_t X509_POLICY_MAPPINGS_OID [3]
 
const uint8_t X509_AUTHORITY_KEY_ID_OID [3]
 
const uint8_t X509_POLICY_CONSTRAINTS_OID [3]
 
const uint8_t X509_EXTENDED_KEY_USAGE_OID [3]
 
const uint8_t X509_FRESHEST_CRL_OID [3]
 
const uint8_t X509_INHIBIT_ANY_POLICY_OID [3]
 
const uint8_t X509_NS_CERT_TYPE_OID [9]
 
const uint8_t X509_ANY_EXT_KEY_USAGE_OID [4]
 
const uint8_t X509_KP_SERVER_AUTH_OID [8]
 
const uint8_t X509_KP_CLIENT_AUTH_OID [8]
 
const uint8_t X509_KP_CODE_SIGNING_OID [8]
 
const uint8_t X509_KP_EMAIL_PROTECTION_OID [8]
 
const uint8_t X509_KP_TIME_STAMPING_OID [8]
 
const uint8_t X509_KP_OCSP_SIGNING_OID [8]
 

Detailed Description

X.509 common definitions.

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_common.h.

Macro Definition Documentation

◆ X509_BRAINPOOLP160R1_SUPPORT

#define X509_BRAINPOOLP160R1_SUPPORT   DISABLED

Definition at line 244 of file x509_common.h.

◆ X509_BRAINPOOLP192R1_SUPPORT

#define X509_BRAINPOOLP192R1_SUPPORT   DISABLED

Definition at line 251 of file x509_common.h.

◆ X509_BRAINPOOLP224R1_SUPPORT

#define X509_BRAINPOOLP224R1_SUPPORT   DISABLED

Definition at line 258 of file x509_common.h.

◆ X509_BRAINPOOLP256R1_SUPPORT

#define X509_BRAINPOOLP256R1_SUPPORT   DISABLED

Definition at line 265 of file x509_common.h.

◆ X509_BRAINPOOLP320R1_SUPPORT

#define X509_BRAINPOOLP320R1_SUPPORT   DISABLED

Definition at line 272 of file x509_common.h.

◆ X509_BRAINPOOLP384R1_SUPPORT

#define X509_BRAINPOOLP384R1_SUPPORT   DISABLED

Definition at line 279 of file x509_common.h.

◆ X509_BRAINPOOLP512R1_SUPPORT

#define X509_BRAINPOOLP512R1_SUPPORT   DISABLED

Definition at line 286 of file x509_common.h.

◆ X509_DSA_SUPPORT

#define X509_DSA_SUPPORT   DISABLED

Definition at line 55 of file x509_common.h.

◆ X509_ECDSA_SUPPORT

#define X509_ECDSA_SUPPORT   ENABLED

Definition at line 62 of file x509_common.h.

◆ X509_ED25519_SUPPORT

#define X509_ED25519_SUPPORT   DISABLED

Definition at line 293 of file x509_common.h.

◆ X509_ED448_SUPPORT

#define X509_ED448_SUPPORT   DISABLED

Definition at line 300 of file x509_common.h.

◆ X509_MAX_DSA_MODULUS_SIZE

#define X509_MAX_DSA_MODULUS_SIZE   4096

Definition at line 328 of file x509_common.h.

◆ X509_MAX_RSA_MODULUS_SIZE

#define X509_MAX_RSA_MODULUS_SIZE   4096

Definition at line 314 of file x509_common.h.

◆ X509_MAX_SUBJECT_ALT_NAMES

#define X509_MAX_SUBJECT_ALT_NAMES   4

Definition at line 335 of file x509_common.h.

◆ X509_MD5_SUPPORT

#define X509_MD5_SUPPORT   DISABLED

Definition at line 69 of file x509_common.h.

◆ X509_MIN_DSA_MODULUS_SIZE

#define X509_MIN_DSA_MODULUS_SIZE   1024

Definition at line 321 of file x509_common.h.

◆ X509_MIN_RSA_MODULUS_SIZE

#define X509_MIN_RSA_MODULUS_SIZE   1024

Definition at line 307 of file x509_common.h.

◆ X509_RSA_PSS_SUPPORT

#define X509_RSA_PSS_SUPPORT   DISABLED

Definition at line 48 of file x509_common.h.

◆ X509_RSA_SUPPORT

#define X509_RSA_SUPPORT   ENABLED

Definition at line 41 of file x509_common.h.

◆ X509_SECP112R1_SUPPORT

#define X509_SECP112R1_SUPPORT   DISABLED

Definition at line 139 of file x509_common.h.

◆ X509_SECP112R2_SUPPORT

#define X509_SECP112R2_SUPPORT   DISABLED

Definition at line 146 of file x509_common.h.

◆ X509_SECP128R1_SUPPORT

#define X509_SECP128R1_SUPPORT   DISABLED

Definition at line 153 of file x509_common.h.

◆ X509_SECP128R2_SUPPORT

#define X509_SECP128R2_SUPPORT   DISABLED

Definition at line 160 of file x509_common.h.

◆ X509_SECP160K1_SUPPORT

#define X509_SECP160K1_SUPPORT   DISABLED

Definition at line 167 of file x509_common.h.

◆ X509_SECP160R1_SUPPORT

#define X509_SECP160R1_SUPPORT   DISABLED

Definition at line 174 of file x509_common.h.

◆ X509_SECP160R2_SUPPORT

#define X509_SECP160R2_SUPPORT   DISABLED

Definition at line 181 of file x509_common.h.

◆ X509_SECP192K1_SUPPORT

#define X509_SECP192K1_SUPPORT   DISABLED

Definition at line 188 of file x509_common.h.

◆ X509_SECP192R1_SUPPORT

#define X509_SECP192R1_SUPPORT   ENABLED

Definition at line 195 of file x509_common.h.

◆ X509_SECP224K1_SUPPORT

#define X509_SECP224K1_SUPPORT   DISABLED

Definition at line 202 of file x509_common.h.

◆ X509_SECP224R1_SUPPORT

#define X509_SECP224R1_SUPPORT   ENABLED

Definition at line 209 of file x509_common.h.

◆ X509_SECP256K1_SUPPORT

#define X509_SECP256K1_SUPPORT   DISABLED

Definition at line 216 of file x509_common.h.

◆ X509_SECP256R1_SUPPORT

#define X509_SECP256R1_SUPPORT   ENABLED

Definition at line 223 of file x509_common.h.

◆ X509_SECP384R1_SUPPORT

#define X509_SECP384R1_SUPPORT   ENABLED

Definition at line 230 of file x509_common.h.

◆ X509_SECP521R1_SUPPORT

#define X509_SECP521R1_SUPPORT   ENABLED

Definition at line 237 of file x509_common.h.

◆ X509_SHA1_SUPPORT

#define X509_SHA1_SUPPORT   ENABLED

Definition at line 76 of file x509_common.h.

◆ X509_SHA224_SUPPORT

#define X509_SHA224_SUPPORT   DISABLED

Definition at line 83 of file x509_common.h.

◆ X509_SHA256_SUPPORT

#define X509_SHA256_SUPPORT   ENABLED

Definition at line 90 of file x509_common.h.

◆ X509_SHA384_SUPPORT

#define X509_SHA384_SUPPORT   ENABLED

Definition at line 97 of file x509_common.h.

◆ X509_SHA3_224_SUPPORT

#define X509_SHA3_224_SUPPORT   DISABLED

Definition at line 111 of file x509_common.h.

◆ X509_SHA3_256_SUPPORT

#define X509_SHA3_256_SUPPORT   DISABLED

Definition at line 118 of file x509_common.h.

◆ X509_SHA3_384_SUPPORT

#define X509_SHA3_384_SUPPORT   DISABLED

Definition at line 125 of file x509_common.h.

◆ X509_SHA3_512_SUPPORT

#define X509_SHA3_512_SUPPORT   DISABLED

Definition at line 132 of file x509_common.h.

◆ X509_SHA512_SUPPORT

#define X509_SHA512_SUPPORT   ENABLED

Definition at line 104 of file x509_common.h.

Enumeration Type Documentation

◆ X509ExtKeyUsage

Extended key usage.

Enumerator
X509_EXT_KEY_USAGE_SERVER_AUTH 
X509_EXT_KEY_USAGE_CLIENT_AUTH 
X509_EXT_KEY_USAGE_CODE_SIGNING 
X509_EXT_KEY_USAGE_EMAIL_PROTECTION 
X509_EXT_KEY_USAGE_TIME_STAMPING 
X509_EXT_KEY_USAGE_OCSP_SIGNING 
X509_EXT_KEY_USAGE_ANY 

Definition at line 380 of file x509_common.h.

◆ X509GeneralNameType

General name types.

Enumerator
X509_GENERAL_NAME_TYPE_OTHER 
X509_GENERAL_NAME_TYPE_RFC822 
X509_GENERAL_NAME_TYPE_DNS 
X509_GENERAL_NAME_TYPE_X400_ADDRESS 
X509_GENERAL_NAME_TYPE_DIRECTORY 
X509_GENERAL_NAME_TYPE_EDI_PARTY 
X509_GENERAL_NAME_TYPE_URI 
X509_GENERAL_NAME_TYPE_IP_ADDRESS 
X509_GENERAL_NAME_TYPE_REGISTERED_ID 

Definition at line 396 of file x509_common.h.

◆ X509HashAlgo

Hash algorithms.

Enumerator
X509_HASH_ALGO_NONE 
X509_HASH_ALGO_MD5 
X509_HASH_ALGO_SHA1 
X509_HASH_ALGO_SHA224 
X509_HASH_ALGO_SHA256 
X509_HASH_ALGO_SHA384 
X509_HASH_ALGO_SHA512 
X509_HASH_ALGO_SHA3_224 
X509_HASH_ALGO_SHA3_256 
X509_HASH_ALGO_SHA3_384 
X509_HASH_ALGO_SHA3_512 

Definition at line 442 of file x509_common.h.

◆ X509KeyUsage

Key usage.

Enumerator
X509_KEY_USAGE_DIGITAL_SIGNATURE 
X509_KEY_USAGE_NON_REPUDIATION 
X509_KEY_USAGE_KEY_ENCIPHERMENT 
X509_KEY_USAGE_DATA_ENCIPHERMENT 
X509_KEY_USAGE_KEY_AGREEMENT 
X509_KEY_USAGE_KEY_CERT_SIGN 
X509_KEY_USAGE_CRL_SIGN 
X509_KEY_USAGE_ENCIPHER_ONLY 
X509_KEY_USAGE_DECIPHER_ONLY 

Definition at line 362 of file x509_common.h.

◆ X509NsCertType

Netscape certificate types.

Enumerator
X509_NS_CERT_TYPE_SSL_CLIENT 
X509_NS_CERT_TYPE_SSL_SERVER 
X509_NS_CERT_TYPE_SSL_CA 

Definition at line 414 of file x509_common.h.

◆ X509SignatureAlgo

Signature algorithms.

Enumerator
X509_SIGN_ALGO_NONE 
X509_SIGN_ALGO_RSA 
X509_SIGN_ALGO_RSA_PSS 
X509_SIGN_ALGO_DSA 
X509_SIGN_ALGO_ECDSA 
X509_SIGN_ALGO_ED25519 
X509_SIGN_ALGO_ED448 

Definition at line 426 of file x509_common.h.

◆ X509Version

X.509 versions.

Enumerator
X509_VERSION_1 
X509_VERSION_2 
X509_VERSION_3 

Definition at line 350 of file x509_common.h.

Function Documentation

◆ x509GetCurveInfo()

const EcCurveInfo* x509GetCurveInfo ( const uint8_t *  oid,
size_t  length 
)

Get the elliptic curve that matches the specified OID.

Parameters
[in]oidObject identifier
[in]lengthOID length
Returns
Elliptic curve domain parameters

Definition at line 846 of file x509_common.c.

◆ x509GetSignHashAlgo()

error_t x509GetSignHashAlgo ( const X509SignatureAlgoId signAlgoId,
X509SignatureAlgo signAlgo,
const HashAlgo **  hashAlgo 
)

Get the signature and hash algorithms that match the specified identifier.

Parameters
[in]signAlgoIdSignature algorithm identifier
[out]signAlgoSignature algorithm
[out]hashAlgoHash algorithm
Returns
Error code

Definition at line 472 of file x509_common.c.

◆ x509IsHashAlgoSupported()

bool_t x509IsHashAlgoSupported ( X509HashAlgo  hashAlgo)

Check whether a given hash algorithm is supported.

Parameters
[in]hashAlgosignature hash
Returns
TRUE is the signature hash is supported, else FALSE

Definition at line 373 of file x509_common.c.

◆ x509IsSignAlgoSupported()

bool_t x509IsSignAlgoSupported ( X509SignatureAlgo  signAlgo)

Check whether a given signature algorithm is supported.

Parameters
[in]signAlgosignature algorithm
Returns
TRUE is the signature algorithm is supported, else FALSE

Definition at line 305 of file x509_common.c.

◆ x509ReadDsaPublicKey()

error_t x509ReadDsaPublicKey ( const X509SubjectPublicKeyInfo subjectPublicKeyInfo,
DsaPublicKey key 
)

Read a DSA public key.

Parameters
[in]subjectPublicKeyInfoPointer to the SubjectPublicKeyInfo structure
[out]keyDSA public key
Returns
Error code

Definition at line 235 of file x509_common.c.

◆ x509ReadInt()

error_t x509ReadInt ( const uint8_t *  data,
size_t  length,
uint_t value 
)

Convert string to integer.

Parameters
[in]dataString containing the representation of an integral number
[in]lengthLength of the string
[out]valueOn success, the function returns the converted integral number
Returns
Error code

Definition at line 152 of file x509_common.c.

◆ x509ReadRsaPublicKey()

error_t x509ReadRsaPublicKey ( const X509SubjectPublicKeyInfo subjectPublicKeyInfo,
RsaPublicKey key 
)

Read a RSA public key.

Parameters
[in]subjectPublicKeyInfoPointer to the SubjectPublicKeyInfo structure
[out]keyRSA public key
Returns
Error code

Definition at line 184 of file x509_common.c.

Variable Documentation

◆ X509_ANY_EXT_KEY_USAGE_OID

const uint8_t X509_ANY_EXT_KEY_USAGE_OID[4]

Definition at line 129 of file x509_common.c.

◆ X509_AUTHORITY_KEY_ID_OID

const uint8_t X509_AUTHORITY_KEY_ID_OID[3]

Definition at line 115 of file x509_common.c.

◆ X509_BASIC_CONSTRAINTS_OID

const uint8_t X509_BASIC_CONSTRAINTS_OID[3]

Definition at line 105 of file x509_common.c.

◆ X509_CERTIFICATE_POLICIES_OID

const uint8_t X509_CERTIFICATE_POLICIES_OID[3]

Definition at line 111 of file x509_common.c.

◆ X509_COMMON_NAME_OID

const uint8_t X509_COMMON_NAME_OID[3]

Definition at line 64 of file x509_common.c.

◆ X509_COUNTRY_NAME_OID

const uint8_t X509_COUNTRY_NAME_OID[3]

Definition at line 70 of file x509_common.c.

◆ X509_CRL_DISTR_POINTS_OID

const uint8_t X509_CRL_DISTR_POINTS_OID[3]

Definition at line 109 of file x509_common.c.

◆ X509_DN_QUALIFIER_OID

const uint8_t X509_DN_QUALIFIER_OID[3]

Definition at line 90 of file x509_common.c.

◆ X509_EXTENDED_KEY_USAGE_OID

const uint8_t X509_EXTENDED_KEY_USAGE_OID[3]

Definition at line 119 of file x509_common.c.

◆ X509_FRESHEST_CRL_OID

const uint8_t X509_FRESHEST_CRL_OID[3]

Definition at line 121 of file x509_common.c.

◆ X509_GENERATION_QUALIFIER_OID

const uint8_t X509_GENERATION_QUALIFIER_OID[3]

Definition at line 88 of file x509_common.c.

◆ X509_GIVEN_NAME_OID

const uint8_t X509_GIVEN_NAME_OID[3]

Definition at line 84 of file x509_common.c.

◆ X509_INHIBIT_ANY_POLICY_OID

const uint8_t X509_INHIBIT_ANY_POLICY_OID[3]

Definition at line 123 of file x509_common.c.

◆ X509_INITIALS_OID

const uint8_t X509_INITIALS_OID[3]

Definition at line 86 of file x509_common.c.

◆ X509_ISSUER_ALT_NAME_OID

const uint8_t X509_ISSUER_ALT_NAME_OID[3]

Definition at line 103 of file x509_common.c.

◆ X509_KEY_USAGE_OID

const uint8_t X509_KEY_USAGE_OID[3]

Definition at line 99 of file x509_common.c.

◆ X509_KP_CLIENT_AUTH_OID

const uint8_t X509_KP_CLIENT_AUTH_OID[8]

Definition at line 133 of file x509_common.c.

◆ X509_KP_CODE_SIGNING_OID

const uint8_t X509_KP_CODE_SIGNING_OID[8]

Definition at line 135 of file x509_common.c.

◆ X509_KP_EMAIL_PROTECTION_OID

const uint8_t X509_KP_EMAIL_PROTECTION_OID[8]

Definition at line 137 of file x509_common.c.

◆ X509_KP_OCSP_SIGNING_OID

const uint8_t X509_KP_OCSP_SIGNING_OID[8]

Definition at line 141 of file x509_common.c.

◆ X509_KP_SERVER_AUTH_OID

const uint8_t X509_KP_SERVER_AUTH_OID[8]

Definition at line 131 of file x509_common.c.

◆ X509_KP_TIME_STAMPING_OID

const uint8_t X509_KP_TIME_STAMPING_OID[8]

Definition at line 139 of file x509_common.c.

◆ X509_LOCALITY_NAME_OID

const uint8_t X509_LOCALITY_NAME_OID[3]

Definition at line 72 of file x509_common.c.

◆ X509_NAME_CONSTRAINTS_OID

const uint8_t X509_NAME_CONSTRAINTS_OID[3]

Definition at line 107 of file x509_common.c.

◆ X509_NAME_OID

const uint8_t X509_NAME_OID[3]

Definition at line 82 of file x509_common.c.

◆ X509_NS_CERT_TYPE_OID

const uint8_t X509_NS_CERT_TYPE_OID[9]

Definition at line 126 of file x509_common.c.

◆ X509_ORGANIZATION_NAME_OID

const uint8_t X509_ORGANIZATION_NAME_OID[3]

Definition at line 76 of file x509_common.c.

◆ X509_ORGANIZATIONAL_UNIT_NAME_OID

const uint8_t X509_ORGANIZATIONAL_UNIT_NAME_OID[3]

Definition at line 78 of file x509_common.c.

◆ X509_POLICY_CONSTRAINTS_OID

const uint8_t X509_POLICY_CONSTRAINTS_OID[3]

Definition at line 117 of file x509_common.c.

◆ X509_POLICY_MAPPINGS_OID

const uint8_t X509_POLICY_MAPPINGS_OID[3]

Definition at line 113 of file x509_common.c.

◆ X509_PSEUDONYM_OID

const uint8_t X509_PSEUDONYM_OID[3]

Definition at line 92 of file x509_common.c.

◆ X509_SERIAL_NUMBER_OID

const uint8_t X509_SERIAL_NUMBER_OID[3]

Definition at line 68 of file x509_common.c.

◆ X509_STATE_OR_PROVINCE_NAME_OID

const uint8_t X509_STATE_OR_PROVINCE_NAME_OID[3]

Definition at line 74 of file x509_common.c.

◆ X509_SUBJECT_ALT_NAME_OID

const uint8_t X509_SUBJECT_ALT_NAME_OID[3]

Definition at line 101 of file x509_common.c.

◆ X509_SUBJECT_DIRECTORY_ATTR_OID

const uint8_t X509_SUBJECT_DIRECTORY_ATTR_OID[3]

Definition at line 95 of file x509_common.c.

◆ X509_SUBJECT_KEY_ID_OID

const uint8_t X509_SUBJECT_KEY_ID_OID[3]

Definition at line 97 of file x509_common.c.

◆ X509_SURNAME_OID

const uint8_t X509_SURNAME_OID[3]

Definition at line 66 of file x509_common.c.

◆ X509_TITLE_OID

const uint8_t X509_TITLE_OID[3]

Definition at line 80 of file x509_common.c.