#ifndef HEADER_CURL_X509ASN1_H
#define HEADER_CURL_X509ASN1_H
#include "../curl_setup.h"
#if defined(USE_GNUTLS) || defined(USE_WOLFSSL) || defined(USE_SCHANNEL) || \
defined(USE_MBEDTLS) || defined(USE_RUSTLS)
#include "../cfilters.h"
#include "../urldata.h"
struct Curl_asn1Element {
const char *header;
const char *beg;
const char *end;
unsigned char eclass;
unsigned char tag;
BIT(constructed);
};
struct Curl_X509certificate {
struct Curl_asn1Element certificate;
struct Curl_asn1Element version;
struct Curl_asn1Element serialNumber;
struct Curl_asn1Element signatureAlgorithm;
struct Curl_asn1Element signature;
struct Curl_asn1Element issuer;
struct Curl_asn1Element notBefore;
struct Curl_asn1Element notAfter;
struct Curl_asn1Element subject;
struct Curl_asn1Element subjectPublicKeyInfo;
struct Curl_asn1Element subjectPublicKeyAlgorithm;
struct Curl_asn1Element subjectPublicKey;
struct Curl_asn1Element issuerUniqueID;
struct Curl_asn1Element subjectUniqueID;
struct Curl_asn1Element extensions;
};
int Curl_parseX509(struct Curl_X509certificate *cert,
const char *beg, const char *end);
CURLcode Curl_extract_certinfo(struct Curl_easy *data, int certnum,
const char *beg, const char *end);
CURLcode Curl_verifyhost(struct Curl_cfilter *cf, struct Curl_easy *data,
const char *beg, const char *end);
#ifdef UNITTESTS
#if defined(USE_GNUTLS) || defined(USE_SCHANNEL) || defined(USE_MBEDTLS) || \
defined(USE_RUSTLS)
CURLcode Curl_x509_GTime2str(struct dynbuf *store,
const char *beg, const char *end);
CURLcode Curl_x509_getASN1Element(struct Curl_asn1Element *elem,
const char *beg, const char *end);
#endif
#endif
#endif
#endif