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

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: For review 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/time/time.h"
16
17 namespace cast_certificate {
18
19 // This class represents the CRL information parsed from the binary proto.
20 class CastCRL {
21 public:
22 virtual ~CastCRL(){};
23
24 // Verifies the revocation status of a cast device certificate given a chain
25 // of DER-encoded certificates.
26 //
27 // Inputs:
28 // * |certs| is a chain of DER-encoded certificates:
29 // * |certs[0]| is the target certificate (i.e. the device certificate)
30 // * |certs[i]| is the certificate that issued certs[i-1]
31 // * |certs.back()| must be signed by a trust anchor
32 //
33 // * |time| is the UTC time to use for determining if the certificate
34 // is revoked.
35 virtual bool VerifyDeviceCertRevocation(const std::vector<std::string>& certs,
36 const base::Time::Exploded& time) = 0;
37 };
38
39 // Parse and verify the CRL used to verify the revocation status of
40 // Cast device certificates.
41 //
42 // Inputs:
43 // * |crl_proto| is the byte representation of the Cast CRL proto
44 // Output:
45 // Returns the CRL object if success, nullptr otherwise.
46 std::unique_ptr<CastCRL> ParseCRL(const std::string& crl_proto);
47
48 // Exposed only for testing, not for use in production code.
49 //
50 // Injects trusted root certificates into the CastCRLTrustStore.
51 // |data| must remain valid and not be mutated throughout the lifetime of
52 // the program.
53 // Warning: Using this function concurrently with VerifyDeviceCert()
54 // is not thread safe.
55 bool AddCRLTrustAnchorForTest(const uint8_t* data,
56 size_t length) WARN_UNUSED_RESULT;
57
58 // Exposed only for testing, not for use in production code.
59 //
60 // Clears trusted root certificates from CastCRLTrustStore
61 void ClearCRLTrustAnchorForTest();
62
63 } // namespace cast_certificate
64
65 #endif // COMPONENTS_CAST_CERTIFICATE_CAST_CRL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698