| 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_SERIALIZATION_H_ | 5 #ifndef NET_CERT_CT_SERIALIZATION_H_ |
| 6 #define NET_CERT_CT_SERIALIZATION_H_ | 6 #define NET_CERT_CT_SERIALIZATION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 const SignedTreeHead& signed_tree_head, | 68 const SignedTreeHead& signed_tree_head, |
| 69 std::string* output); | 69 std::string* output); |
| 70 | 70 |
| 71 // Decode a list of Signed Certificate Timestamps | 71 // Decode a list of Signed Certificate Timestamps |
| 72 // (SignedCertificateTimestampList as defined in RFC6962): from a single | 72 // (SignedCertificateTimestampList as defined in RFC6962): from a single |
| 73 // string in |input| to a vector of individually-encoded SCTs |output|. | 73 // string in |input| to a vector of individually-encoded SCTs |output|. |
| 74 // This list is typically obtained from the CT extension in a certificate. | 74 // This list is typically obtained from the CT extension in a certificate. |
| 75 // Returns true if the list could be read and decoded successfully, false | 75 // Returns true if the list could be read and decoded successfully, false |
| 76 // otherwise (note that the validity of each individual SCT should be checked | 76 // otherwise (note that the validity of each individual SCT should be checked |
| 77 // separately). | 77 // separately). |
| 78 NET_EXPORT_PRIVATE bool DecodeSCTList(base::StringPiece* input, | 78 NET_EXPORT_PRIVATE bool DecodeSCTList(base::StringPiece input, |
| 79 std::vector<base::StringPiece>* output); | 79 std::vector<base::StringPiece>* output); |
| 80 | 80 |
| 81 // Decodes a single SCT from |input| to |output|. | 81 // Decodes a single SCT from |input| to |output|. |
| 82 // Returns true if all fields in the SCT could be read and decoded, false | 82 // Returns true if all fields in the SCT could be read and decoded, false |
| 83 // otherwise. | 83 // otherwise. |
| 84 NET_EXPORT_PRIVATE bool DecodeSignedCertificateTimestamp( | 84 NET_EXPORT_PRIVATE bool DecodeSignedCertificateTimestamp( |
| 85 base::StringPiece* input, | 85 base::StringPiece* input, |
| 86 scoped_refptr<ct::SignedCertificateTimestamp>* output); | 86 scoped_refptr<ct::SignedCertificateTimestamp>* output); |
| 87 | 87 |
| 88 // Writes an SCTList into |output|, containing a single |sct|. | 88 // Writes an SCTList into |output|, containing a single |sct|. |
| 89 NET_EXPORT_PRIVATE bool EncodeSCTListForTesting(const base::StringPiece& sct, | 89 NET_EXPORT_PRIVATE bool EncodeSCTListForTesting(const base::StringPiece& sct, |
| 90 std::string* output); | 90 std::string* output); |
| 91 } // namespace ct | 91 } // namespace ct |
| 92 | 92 |
| 93 } // namespace net | 93 } // namespace net |
| 94 | 94 |
| 95 #endif // NET_CERT_CT_SERIALIZATION_H_ | 95 #endif // NET_CERT_CT_SERIALIZATION_H_ |
| OLD | NEW |