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

Side by Side Diff: components/cast_certificate/cast_crl.h

Issue 2050983002: Cast device revocation checking. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test suite runner. Updated some tests. 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 COMPONENTS_CAST_CERTIFICATE_CAST_CRL_H_
6 #define COMPONENTS_CAST_CERTIFICATE_CAST_CRL_H_
7
8 #include <memory>
9 #include <string>
10 #include <unordered_map>
11 #include <unordered_set>
12 #include <vector>
13
14 #include "base/compiler_specific.h"
15 #include "base/memory/ref_counted.h"
16 #include "base/time/time.h"
17
18 namespace net {
19 class ParsedCertificate;
20 } // namespace net
21
22 namespace cast_certificate {
23
24 // This class represents the CRL information parsed from the binary proto.
25 class CastCRL {
26 public:
27 virtual ~CastCRL(){};
28
29 // Verifies the revocation status of a cast device certificate given a chain
30 // of DER-encoded certificates.
31 //
32 // Inputs:
33 // * |certs| is the verified chain of DER-encoded certificates:
34 // * |certs[0]| is the target certificate (i.e. the device certificate)
35 // * |certs[i]| is the certificate that issued certs[i-1]
36 // * |certs.back()| must be trusted anchor.
37 //
38 // * |time| is the UTC time to use for determining if the certificate
39 // is revoked.
40 virtual bool CheckRevocation(
41 const std::vector<scoped_refptr<net::ParsedCertificate>>& certs,
42 const base::Time::Exploded& time) const = 0;
43 };
44
45 // Parse and verify the CRL used to verify the revocation status of
46 // Cast device certificates.
47 //
48 // Inputs:
49 // * |crl_proto| is the byte representation of the Cast CRL proto.
50 // * |time| is the UTC time to use for determining if the CRL is valid.
51 // Output:
52 // Returns the CRL object if success, nullptr otherwise.
53 std::unique_ptr<CastCRL> ParseCRL(const std::string& crl_proto,
sheretov 2016/06/24 20:24:31 How about "ParseAndVerifyCrl"?
ryanchung 2016/06/29 22:09:48 Done.
54 const base::Time::Exploded& time);
55
56 // Exposed only for testing, not for use in production code.
57 //
58 // Injects trusted root certificates into the CastCRLTrustStore.
59 // |data| must remain valid and not be mutated throughout the lifetime of
60 // the program.
61 // Warning: Using this function concurrently with CheckRevocation()
62 // is not thread safe.
63 bool AddCRLTrustAnchorForTest(const uint8_t* data,
sheretov 2016/06/24 20:24:31 I have a couple suggestions, both aimed at making
ryanchung 2016/06/29 22:09:48 Done. Keeping them separate for now because we pla
64 size_t length) WARN_UNUSED_RESULT;
65
66 // Exposed only for testing, not for use in production code.
67 //
68 // Clears trusted root certificates from CastCRLTrustStore
69 void ClearCRLTrustAnchorForTest();
70
71 } // namespace cast_certificate
72
73 #endif // COMPONENTS_CAST_CERTIFICATE_CAST_CRL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698