2022-08-30 21:18:15 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: TLSCertificateChain.hpp
|
|
|
|
Date: 2022-8-27
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
namespace Aurora::IO::TLS
|
|
|
|
{
|
2022-11-18 04:15:05 +00:00
|
|
|
struct CertificateChain : ICertificateChain, AuEnableSharedFromThis<CertificateChain>
|
2022-08-30 21:18:15 +00:00
|
|
|
{
|
|
|
|
CertificateChain();
|
|
|
|
~CertificateChain();
|
|
|
|
|
|
|
|
virtual AuUInt32 GetCertificateCount() override;
|
2022-11-18 04:15:05 +00:00
|
|
|
virtual AuSPtr<AuMemoryViewRead> GetCertificate(AuUInt32 idx) override;
|
|
|
|
virtual Crypto::X509::DecodedCertificate GetCertificateDetails(AuUInt32 idx) override;
|
2022-08-30 21:18:15 +00:00
|
|
|
|
|
|
|
bool Init(const AuList<AuByteBuffer> &certs);
|
|
|
|
bool Init(const AuList<AuMemoryViewRead> &certs);
|
|
|
|
bool Init(const AuMemoryViewRead &cert);
|
|
|
|
bool Init(const mbedtls_x509_crt *pCert);
|
|
|
|
|
|
|
|
bool Precache();
|
|
|
|
|
|
|
|
mbedtls_x509_crt *pCertificate;
|
2022-12-16 00:41:01 +00:00
|
|
|
mbedtls_x509_crt ownCertificate {};
|
2022-08-30 21:18:15 +00:00
|
|
|
};
|
|
|
|
}
|