| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 NET_CERT_CT_LOG_VERIFIER_H_ | 5 #ifndef NET_CERT_CT_LOG_VERIFIER_H_ |
| 6 #define NET_CERT_CT_LOG_VERIFIER_H_ | 6 #define NET_CERT_CT_LOG_VERIFIER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 namespace net { | 24 namespace net { |
| 25 | 25 |
| 26 // Class for verifying Signed Certificate Timestamps (SCTs) provided by a | 26 // Class for verifying Signed Certificate Timestamps (SCTs) provided by a |
| 27 // specific log (whose identity is provided during construction). | 27 // specific log (whose identity is provided during construction). |
| 28 class NET_EXPORT CTLogVerifier { | 28 class NET_EXPORT CTLogVerifier { |
| 29 public: | 29 public: |
| 30 // Creates a new CTLogVerifier that will verify SignedCertificateTimestamps | 30 // Creates a new CTLogVerifier that will verify SignedCertificateTimestamps |
| 31 // using |public_key|, which is a DER-encoded SubjectPublicKeyInfo. | 31 // using |public_key|, which is a DER-encoded SubjectPublicKeyInfo. |
| 32 // If |public_key| refers to an unsupported public key, returns NULL. | 32 // If |public_key| refers to an unsupported public key, returns NULL. |
| 33 // |description| is a textual description of the log. | 33 // |description| is a textual description of the log. |
| 34 static scoped_ptr<CTLogVerifier> Create( | 34 static scoped_ptr<CTLogVerifier> Create(const base::StringPiece& public_key, |
| 35 const base::StringPiece& public_key, | 35 const base::StringPiece& description); |
| 36 const base::StringPiece& description); | |
| 37 | 36 |
| 38 ~CTLogVerifier(); | 37 ~CTLogVerifier(); |
| 39 | 38 |
| 40 // Returns the log's key ID (RFC6962, Section 3.2) | 39 // Returns the log's key ID (RFC6962, Section 3.2) |
| 41 const std::string& key_id() const { return key_id_; } | 40 const std::string& key_id() const { return key_id_; } |
| 42 // Returns the log's human-readable description. | 41 // Returns the log's human-readable description. |
| 43 const std::string& description() const { return description_; } | 42 const std::string& description() const { return description_; } |
| 44 | 43 |
| 45 // Verifies that |sct| contains a valid signature for |entry|. | 44 // Verifies that |sct| contains a valid signature for |entry|. |
| 46 bool Verify(const ct::LogEntry& entry, | 45 bool Verify(const ct::LogEntry& entry, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 69 #if defined(USE_OPENSSL) | 68 #if defined(USE_OPENSSL) |
| 70 EVP_PKEY* public_key_; | 69 EVP_PKEY* public_key_; |
| 71 #else | 70 #else |
| 72 SECKEYPublicKey* public_key_; | 71 SECKEYPublicKey* public_key_; |
| 73 #endif | 72 #endif |
| 74 }; | 73 }; |
| 75 | 74 |
| 76 } // namespace net | 75 } // namespace net |
| 77 | 76 |
| 78 #endif // NET_CERT_CT_LOG_VERIFIER_H_ | 77 #endif // NET_CERT_CT_LOG_VERIFIER_H_ |
| OLD | NEW |