Chromium Code Reviews| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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. |
|
eroman
2016/07/01 23:49:29
"Their ordering does not matter".
mattm
2016/07/02 02:21:51
Done.
| |
| 59 // * |certs.back()| must be signed by a trust anchor | |
| 60 // | 59 // |
| 61 // * |time| is the UTC time to use for determining if the certificate | 60 // * |time| is the UTC time to use for determining if the certificate |
| 62 // is expired. | 61 // is expired. |
| 63 // | 62 // |
| 64 // Outputs: | 63 // Outputs: |
| 65 // | 64 // |
| 66 // Returns true on success, false on failure. On success the output | 65 // Returns true on success, false on failure. On success the output |
| 67 // parameters are filled with more details: | 66 // parameters are filled with more details: |
| 68 // | 67 // |
| 69 // * |context| is filled with an object that can be used to verify signatures | 68 // * |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 | 89 // |data| must remain valid and not be mutated throughout the lifetime of |
| 91 // the program. | 90 // the program. |
| 92 // Warning: Using this function concurrently with VerifyDeviceCert() | 91 // Warning: Using this function concurrently with VerifyDeviceCert() |
| 93 // is not thread safe. | 92 // is not thread safe. |
| 94 bool AddTrustAnchorForTest(const uint8_t* data, | 93 bool AddTrustAnchorForTest(const uint8_t* data, |
| 95 size_t length) WARN_UNUSED_RESULT; | 94 size_t length) WARN_UNUSED_RESULT; |
| 96 | 95 |
| 97 } // namespace cast_certificate | 96 } // namespace cast_certificate |
| 98 | 97 |
| 99 #endif // COMPONENTS_CAST_CERTIFICATE_CAST_CERT_VALIDATOR_H_ | 98 #endif // COMPONENTS_CAST_CERTIFICATE_CAST_CERT_VALIDATOR_H_ |
| OLD | NEW |