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 22 matching lines...) Expand all Loading... |
33 class NET_EXPORT CTLogVerifier { | 33 class NET_EXPORT CTLogVerifier { |
34 public: | 34 public: |
35 // Creates a new CTLogVerifier that will verify SignedCertificateTimestamps | 35 // Creates a new CTLogVerifier that will verify SignedCertificateTimestamps |
36 // using |public_key|, which is a DER-encoded SubjectPublicKeyInfo. | 36 // using |public_key|, which is a DER-encoded SubjectPublicKeyInfo. |
37 // If |public_key| refers to an unsupported public key, returns NULL. | 37 // If |public_key| refers to an unsupported public key, returns NULL. |
38 // |description| is a textual description of the log. | 38 // |description| is a textual description of the log. |
39 static scoped_ptr<CTLogVerifier> Create(const base::StringPiece& public_key, | 39 static scoped_ptr<CTLogVerifier> Create(const base::StringPiece& public_key, |
40 const base::StringPiece& description, | 40 const base::StringPiece& description, |
41 const base::StringPiece& url); | 41 const base::StringPiece& url); |
42 | 42 |
| 43 // Copy constructor |
| 44 CTLogVerifier(const CTLogVerifier& other); |
| 45 |
43 ~CTLogVerifier(); | 46 ~CTLogVerifier(); |
44 | 47 |
45 // Returns the log's key ID (RFC6962, Section 3.2) | 48 // Returns the log's key ID (RFC6962, Section 3.2) |
46 const std::string& key_id() const { return key_id_; } | 49 const std::string& key_id() const { return key_id_; } |
47 // Returns the log's human-readable description. | 50 // Returns the log's human-readable description. |
48 const std::string& description() const { return description_; } | 51 const std::string& description() const { return description_; } |
| 52 // Returns the log's URL |
| 53 const GURL& url() const { return url_; } |
49 | 54 |
50 // Verifies that |sct| contains a valid signature for |entry|. | 55 // Verifies that |sct| contains a valid signature for |entry|. |
51 bool Verify(const ct::LogEntry& entry, | 56 bool Verify(const ct::LogEntry& entry, |
52 const ct::SignedCertificateTimestamp& sct); | 57 const ct::SignedCertificateTimestamp& sct); |
53 | 58 |
54 // Returns true if the signature in |signed_tree_head| verifies. | 59 // Returns true if the signature in |signed_tree_head| verifies. |
55 bool VerifySignedTreeHead(const ct::SignedTreeHead& signed_tree_head); | 60 bool VerifySignedTreeHead(const ct::SignedTreeHead& signed_tree_head); |
56 | 61 |
57 private: | 62 private: |
58 FRIEND_TEST_ALL_PREFIXES(CTLogVerifierTest, VerifySignature); | 63 FRIEND_TEST_ALL_PREFIXES(CTLogVerifierTest, VerifySignature); |
(...skipping 22 matching lines...) Expand all Loading... |
81 #if defined(USE_OPENSSL) | 86 #if defined(USE_OPENSSL) |
82 EVP_PKEY* public_key_; | 87 EVP_PKEY* public_key_; |
83 #else | 88 #else |
84 SECKEYPublicKey* public_key_; | 89 SECKEYPublicKey* public_key_; |
85 #endif | 90 #endif |
86 }; | 91 }; |
87 | 92 |
88 } // namespace net | 93 } // namespace net |
89 | 94 |
90 #endif // NET_CERT_CT_LOG_VERIFIER_H_ | 95 #endif // NET_CERT_CT_LOG_VERIFIER_H_ |
OLD | NEW |