Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: net/cert/internal/cert_source_static.h

Issue 2030693002: Add CertIssuerSource interface and CertIssuerSourceStatic implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert-parsing-base
Patch Set: . Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
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_SOURCE_STATIC_H_
6 #define NET_CERT_INTERNAL_CERT_SOURCE_STATIC_H_
7
8 #include <unordered_map>
9
10 #include "base/strings/string_piece.h"
11 #include "net/cert/internal/cert_source.h"
12
13 namespace net {
14
15 // Synchronously returns issuers from a pre-supplied set.
16 class NET_EXPORT CertSourceStatic : public CertSource {
17 public:
18 CertSourceStatic();
19 ~CertSourceStatic() override;
20
21 // Adds |cert| to the set of certificates that this CertSource will provide.
22 void AddCert(scoped_refptr<ParsedCertificate> cert);
23
24 // CertSource implementation:
25 void SyncGetIssuersOf(
26 const ParsedCertificate* cert,
27 std::vector<scoped_refptr<ParsedCertificate>>* issuers) override;
28 void AsyncGetIssuersOf(const ParsedCertificate* cert,
29 const IssuerCallback& issuers_callback,
30 std::unique_ptr<Request>* out_req) override;
31
32 private:
33 // The certificates that the CertSourceStatic can return, keyed on the
34 // normalized subject value.
35 std::unordered_multimap<base::StringPiece,
36 scoped_refptr<ParsedCertificate>,
37 base::StringPieceHash>
38 intermediates_;
39
40 DISALLOW_COPY_AND_ASSIGN(CertSourceStatic);
41 };
42
43 } // namespace net
44
45 #endif // NET_CERT_INTERNAL_CERT_SOURCE_STATIC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698