OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_CAST_CERTIFICATE_CAST_CERT_VALIDATOR_H_ | 5 #ifndef COMPONENTS_CAST_CERTIFICATE_CAST_CERT_VALIDATOR_H_ |
6 #define COMPONENTS_CAST_CERTIFICATE_CAST_CERT_VALIDATOR_H_ | 6 #define COMPONENTS_CAST_CERTIFICATE_CAST_CERT_VALIDATOR_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 private: | 48 private: |
49 DISALLOW_COPY_AND_ASSIGN(CertVerificationContext); | 49 DISALLOW_COPY_AND_ASSIGN(CertVerificationContext); |
50 }; | 50 }; |
51 | 51 |
52 // Verifies a cast device certficate given a chain of DER-encoded certificates. | 52 // Verifies a cast device certficate given a chain of DER-encoded certificates. |
53 // | 53 // |
54 // Inputs: | 54 // Inputs: |
55 // | 55 // |
56 // * |certs| is a chain of DER-encoded certificates: | 56 // * |certs| is a chain of DER-encoded certificates: |
57 // * |certs[0]| is the target certificate (i.e. the device certificate) | 57 // * |certs[0]| is the target certificate (i.e. the device certificate). |
58 // * |certs[i]| is the certificate that issued certs[i-1] | 58 // * |certs[1..n-1]| are intermediates certificates to use in path building. |
59 // * |certs.back()| must be signed by a trust anchor | 59 // Their ordering does not matter. |
60 // | 60 // |
61 // * |time| is the UTC time to use for determining if the certificate | 61 // * |time| is the UTC time to use for determining if the certificate |
62 // is expired. | 62 // is expired. |
63 // | 63 // |
64 // Outputs: | 64 // Outputs: |
65 // | 65 // |
66 // Returns true on success, false on failure. On success the output | 66 // Returns true on success, false on failure. On success the output |
67 // parameters are filled with more details: | 67 // parameters are filled with more details: |
68 // | 68 // |
69 // * |context| is filled with an object that can be used to verify signatures | 69 // * |context| is filled with an object that can be used to verify signatures |
(...skipping 20 matching lines...) Expand all Loading... |
90 // |data| must remain valid and not be mutated throughout the lifetime of | 90 // |data| must remain valid and not be mutated throughout the lifetime of |
91 // the program. | 91 // the program. |
92 // Warning: Using this function concurrently with VerifyDeviceCert() | 92 // Warning: Using this function concurrently with VerifyDeviceCert() |
93 // is not thread safe. | 93 // is not thread safe. |
94 bool AddTrustAnchorForTest(const uint8_t* data, | 94 bool AddTrustAnchorForTest(const uint8_t* data, |
95 size_t length) WARN_UNUSED_RESULT; | 95 size_t length) WARN_UNUSED_RESULT; |
96 | 96 |
97 } // namespace cast_certificate | 97 } // namespace cast_certificate |
98 | 98 |
99 #endif // COMPONENTS_CAST_CERTIFICATE_CAST_CERT_VALIDATOR_H_ | 99 #endif // COMPONENTS_CAST_CERTIFICATE_CAST_CERT_VALIDATOR_H_ |
OLD | NEW |