xref: /aosp_15_r20/external/cronet/net/cert/internal/cert_issuer_source_aia.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2016 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef NET_CERT_INTERNAL_CERT_ISSUER_SOURCE_AIA_H_
6 #define NET_CERT_INTERNAL_CERT_ISSUER_SOURCE_AIA_H_
7 
8 #include "base/memory/scoped_refptr.h"
9 #include "net/base/net_export.h"
10 #include "third_party/boringssl/src/pki/cert_issuer_source.h"
11 
12 namespace net {
13 
14 class CertNetFetcher;
15 
16 class NET_EXPORT CertIssuerSourceAia : public bssl::CertIssuerSource {
17  public:
18   // Creates bssl::CertIssuerSource that will use |cert_fetcher| to retrieve
19   // issuers using AuthorityInfoAccess URIs. CertIssuerSourceAia must be created
20   // and used only on a single thread, which is the thread |cert_fetcher| will
21   // be operated from.
22   explicit CertIssuerSourceAia(scoped_refptr<CertNetFetcher> cert_fetcher);
23 
24   CertIssuerSourceAia(const CertIssuerSourceAia&) = delete;
25   CertIssuerSourceAia& operator=(const CertIssuerSourceAia&) = delete;
26 
27   ~CertIssuerSourceAia() override;
28 
29   // bssl::CertIssuerSource implementation:
30   void SyncGetIssuersOf(const bssl::ParsedCertificate* cert,
31                         bssl::ParsedCertificateList* issuers) override;
32   void AsyncGetIssuersOf(const bssl::ParsedCertificate* cert,
33                          std::unique_ptr<Request>* out_req) override;
34 
35  private:
36   scoped_refptr<CertNetFetcher> cert_fetcher_;
37 };
38 
39 }  // namespace net
40 
41 #endif  // NET_CERT_INTERNAL_CERT_ISSUER_SOURCE_AIA_H_
42