Index: net/cert/ct_serialization.h |
diff --git a/net/cert/ct_serialization.h b/net/cert/ct_serialization.h |
index f183247469f9e217e017894b425c8af095127817..fddae120eebfe52781d00c8f60bd52e2c0cbc6a1 100644 |
--- a/net/cert/ct_serialization.h |
+++ b/net/cert/ct_serialization.h |
@@ -10,6 +10,7 @@ |
#include "base/strings/string_piece.h" |
#include "net/base/net_export.h" |
+#include "net/cert/ct_trans_item.h" |
#include "net/cert/signed_certificate_timestamp.h" |
#include "net/cert/signed_tree_head.h" |
@@ -19,6 +20,9 @@ namespace net { |
// Transparency to/from the TLS wire format encoding. |
namespace ct { |
+struct MerkleConsistencyProof; |
+struct TransItem; |
Eran Messeri
2016/01/14 12:46:45
Unnecessary as you're including ct_trans_item.h
|
+ |
// If |input.signature_data| is less than kMaxSignatureLength, encodes the |
// |input| to |output| and returns true. Otherwise, returns false. |
NET_EXPORT_PRIVATE bool EncodeDigitallySigned(const DigitallySigned& input, |
@@ -73,9 +77,43 @@ NET_EXPORT_PRIVATE bool DecodeSignedCertificateTimestamp( |
base::StringPiece* input, |
scoped_refptr<ct::SignedCertificateTimestamp>* output); |
+NET_EXPORT_PRIVATE bool EncodeSignedCertificateTimestamp( |
+ const SignedCertificateTimestamp& input, |
+ std::string* output); |
+ |
// Writes an SCTList into |output|, containing a single |sct|. |
NET_EXPORT_PRIVATE bool EncodeSCTListForTesting(const base::StringPiece& sct, |
std::string* output); |
+ |
+NET_EXPORT_PRIVATE bool DecodeSignedTreeHead(base::StringPiece* input, |
Eran Messeri
2016/01/14 12:46:45
Comment that all of these are from RFC6962-bis, no
|
+ SignedTreeHead* output); |
+ |
+NET_EXPORT_PRIVATE bool EncodeSignedTreeHead(const SignedTreeHead& sth, |
+ std::string* output); |
+ |
+NET_EXPORT_PRIVATE bool DecodeConsistencyProof(base::StringPiece* input, |
+ MerkleConsistencyProof* output); |
+ |
+NET_EXPORT_PRIVATE bool EncodeConsistencyProof( |
+ const MerkleConsistencyProof& input, |
+ std::string* output); |
+ |
+// Decodes a CT item from |input| to |output|. |
+// Any pointers in |output| are owned by the caller. |
+// Returns true if all fields in the TransItem could be read and decoded, false |
+// otherwise. |
+NET_EXPORT bool DecodeTransItem(base::StringPiece* input, TransItem* output); |
+ |
+NET_EXPORT_PRIVATE bool DecodeTransItem(base::StringPiece* input, |
+ TransItemV1* output); |
+ |
+// Encodes the TransItem |input| into |output|. |
+// Returns true if all of the fields in the TransItem could be encoded and |
+// written, false otherwise. |
+NET_EXPORT bool EncodeTransItem(const TransItem& input, std::string* output); |
+ |
+NET_EXPORT bool EncodeTransItem(const TransItemV1& input, std::string* output); |
+ |
} // namespace ct |
} // namespace net |