J Reece Wilson
7a0593adeb
[+] AuCrypto::CA::INewCertificateStore [+] AuCrypto::CA::IPinCertificate [+] AuCrypto::CA::PinAlwaysFail [+] AuCrypto::CA::PinAlwaysPass [+] AuCrypto::CA::PinCheckOS [+] AuCrypto::CA::PinCheckDefault [+] AuCrypto::CA::PinCheckBuiltin [+] AuCrypto::CA::PinCheckGlobal [+] AuCrypto::CA::PinCheckTwoAnd [+] AuCrypto::CA::PinCheckTwoOr [+] AuCrypto::CA::SetGlobalTLSPinner [*] Minor AuCrypto::X509 decoder work [*] AuCrypto::X509: transition to memory views (x509 is bytebuffer era and earlier code, beri early) [+] AuCrypto::IPrivateKeyProvider [+] AuCrypto::IPrivateKeyPair [+] AuCrypto::PrivateKeyPair [+] AuCrypto::ImportPrivateKeyPair [*] Refactor: AuCrypto::X509::GenerateCertificate(...) [+] AuCrypto::X509::NewChainFromOneDer [+] AuCrypto::X509::NewChainFromManyDer [+] AuCrypto::X509::NewChainFromManyDerInStream [+] AuCrypto::X509::NewChainFromOnePem [+] AuCrypto::X509::NewChainFromManyPem [+] AuCrypto::X509::NewChainFromManyPemInStream [*] Fix TLS code that was abandoned since its introduction with the net code. mbedtls is a hairbrained mess. so many *blocking* github issues starting after 2017. so little progress. [+] AuIO::TLS::TLSMeta::pKeyPairProvider [+] AuIO::TLS::TLSServer::bAllowSNIToFallBackDefault [+] AuIO::TLS::TLSServer::bAllowSNILessUseDefaultCert
45 lines
1.4 KiB
C++
45 lines
1.4 KiB
C++
/***
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: AuCertificateChain.hpp
|
|
Date: 2022-8-27
|
|
Author: Reece
|
|
***/
|
|
#pragma once
|
|
|
|
#include <mbedtls/entropy.h>
|
|
#include <mbedtls/x509.h>
|
|
#include <mbedtls/oid.h>
|
|
#include <mbedtls/x509_crt.h>
|
|
|
|
namespace Aurora::Crypto::X509
|
|
{
|
|
struct CertificateChain : ICertificateChain, AuEnableSharedFromThis<CertificateChain>
|
|
{
|
|
CertificateChain();
|
|
~CertificateChain();
|
|
|
|
virtual AuUInt32 GetCertificateCount() override;
|
|
virtual AuMemoryViewRead GetCertificate(AuUInt32 idx) override;
|
|
virtual AuOptional<const CertificateDecoded &> GetCertificateDetails(AuUInt32 idx) override;
|
|
|
|
mbedtls_x509_crt *GetCertificateInternal(AuUInt32 idx);
|
|
|
|
bool Init(const AuList<AuMemoryViewRead> &certs);
|
|
bool Init(const AuMemoryViewRead &cert);
|
|
bool Init2(const AuMemoryViewRead &cert);
|
|
bool Init(const AuList<AuROString> &certs);
|
|
bool Init(const AuROString &cert);
|
|
bool Init2(const AuROString &cert);
|
|
bool Init(const mbedtls_x509_crt *pCert);
|
|
|
|
bool Precache();
|
|
|
|
mbedtls_x509_crt *pCertificate;
|
|
mbedtls_x509_crt ownCertificate {};
|
|
AuList<Crypto::X509::CertificateDecoded> decoded;
|
|
AuMutex mutex;
|
|
AuList<AuMemoryViewRead> ownership;
|
|
AuMemoryViewRead ownership2;
|
|
};
|
|
} |