// Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. #ifndef CEF_LIBCEF_BROWSER_X509_CERTIFICATE_IMPL_H_ #define CEF_LIBCEF_BROWSER_X509_CERTIFICATE_IMPL_H_ #pragma once #include #include "cef/include/cef_x509_certificate.h" #include "net/cert/x509_certificate.h" #include "net/ssl/client_cert_identity.h" // CefX509Certificate implementation class CefX509CertificateImpl : public CefX509Certificate { public: explicit CefX509CertificateImpl(scoped_refptr cert); CefX509CertificateImpl(const CefX509CertificateImpl&) = delete; CefX509CertificateImpl& operator=(const CefX509CertificateImpl&) = delete; explicit CefX509CertificateImpl( std::unique_ptr identity); // CefX509Certificate methods. CefRefPtr GetSubject() override; CefRefPtr GetIssuer() override; CefRefPtr GetSerialNumber() override; CefBaseTime GetValidStart() override; CefBaseTime GetValidExpiry() override; CefRefPtr GetDEREncoded() override; CefRefPtr GetPEMEncoded() override; size_t GetIssuerChainSize() override; void GetDEREncodedIssuerChain(IssuerChainBinaryList& chain) override; void GetPEMEncodedIssuerChain(IssuerChainBinaryList& chain) override; scoped_refptr GetInternalCertObject() { return cert_; } void AcquirePrivateKey( base::OnceCallback)> private_key_callback); [[nodiscard]] std::unique_ptr DisconnectIdentity(); private: void GetEncodedIssuerChain(IssuerChainBinaryList& chain, bool der); std::unique_ptr identity_; scoped_refptr cert_; IssuerChainBinaryList pem_encoded_issuer_chain_; IssuerChainBinaryList der_encoded_issuer_chain_; IMPLEMENT_REFCOUNTING(CefX509CertificateImpl); }; #endif // CEF_LIBCEF_BROWSER_X509_CERTIFICATE_IMPL_H_