| 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 EXTENSIONS_COMMON_CAST_CAST_CERT_VALIDATOR_H_ |    5 #ifndef EXTENSIONS_COMMON_CAST_CAST_CERT_VALIDATOR_H_ | 
|    6 #define EXTENSIONS_COMMON_CAST_CAST_CERT_VALIDATOR_H_ |    6 #define EXTENSIONS_COMMON_CAST_CAST_CERT_VALIDATOR_H_ | 
|    7  |    7  | 
|    8 #include <string> |    8 #include <string> | 
|    9 #include <vector> |    9 #include <vector> | 
|   10  |   10  | 
|   11 #include "base/memory/scoped_ptr.h" |   11 #include "base/memory/scoped_ptr.h" | 
|   12 #include "base/strings/string_piece.h" |   12 #include "base/strings/string_piece.h" | 
|   13  |   13  | 
|   14 namespace extensions { |   14 namespace extensions { | 
|   15 namespace core_api { |   15 namespace api { | 
|   16 namespace cast_crypto { |   16 namespace cast_crypto { | 
|   17  |   17  | 
|   18 // Status of a certificate or certificate verification operation. |   18 // Status of a certificate or certificate verification operation. | 
|   19 struct VerificationResult { |   19 struct VerificationResult { | 
|   20   // Mapped to extensions::core_api::cast_channel::AuthResult::ErrorType in |   20   // Mapped to extensions::api::cast_channel::AuthResult::ErrorType in | 
|   21   // cast_auto_util.cc. Update the mapping code when modifying this enum. |   21   // cast_auto_util.cc. Update the mapping code when modifying this enum. | 
|   22   enum ErrorType { |   22   enum ErrorType { | 
|   23     // Verification has succeeded. |   23     // Verification has succeeded. | 
|   24     ERROR_NONE = 0, |   24     ERROR_NONE = 0, | 
|   25     // There was a problem with the certificate, such as invalid or corrupt |   25     // There was a problem with the certificate, such as invalid or corrupt | 
|   26     // certificate data or invalid issuing certificate signature. |   26     // certificate data or invalid issuing certificate signature. | 
|   27     ERROR_CERT_INVALID, |   27     ERROR_CERT_INVALID, | 
|   28     // Certificate may be valid, but not trusted in this context. |   28     // Certificate may be valid, but not trusted in this context. | 
|   29     ERROR_CERT_UNTRUSTED, |   29     ERROR_CERT_UNTRUSTED, | 
|   30     // Signature verification failed |   30     // Signature verification failed | 
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   87 VerificationResult VerifyDeviceCert( |   87 VerificationResult VerifyDeviceCert( | 
|   88     const base::StringPiece& device_cert, |   88     const base::StringPiece& device_cert, | 
|   89     const std::vector<std::string>& ica_certs, |   89     const std::vector<std::string>& ica_certs, | 
|   90     scoped_ptr<CertVerificationContext>* context); |   90     scoped_ptr<CertVerificationContext>* context); | 
|   91  |   91  | 
|   92 // Sets trusted certificate authorities. Only exposed for tests. |   92 // Sets trusted certificate authorities. Only exposed for tests. | 
|   93 bool SetTrustedCertificateAuthoritiesForTest(const std::string& keys, |   93 bool SetTrustedCertificateAuthoritiesForTest(const std::string& keys, | 
|   94                                              const std::string& signature); |   94                                              const std::string& signature); | 
|   95  |   95  | 
|   96 }  // namespace cast_crypto |   96 }  // namespace cast_crypto | 
|   97 }  // namespace core_api |   97 }  // namespace api | 
|   98 }  // namespace extensions |   98 }  // namespace extensions | 
|   99  |   99  | 
|  100 #endif  // EXTENSIONS_COMMON_CAST_CAST_CERT_VALIDATOR_H_ |  100 #endif  // EXTENSIONS_COMMON_CAST_CAST_CERT_VALIDATOR_H_ | 
| OLD | NEW |