Home | History | Annotate | Download | only in cert
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef NET_CERT_SIGNED_TREE_HEAD_H_
      6 #define NET_CERT_SIGNED_TREE_HEAD_H_
      7 
      8 #include <string>
      9 #include <vector>
     10 
     11 #include "base/time/time.h"
     12 #include "net/base/hash_value.h"
     13 #include "net/base/net_export.h"
     14 #include "net/cert/signed_certificate_timestamp.h"
     15 
     16 namespace net {
     17 
     18 namespace ct {
     19 
     20 static const uint8 kSthRootHashLength = 32;
     21 
     22 // Signed Tree Head as defined in section 3.5. of RFC6962
     23 struct NET_EXPORT SignedTreeHead {
     24   // Version enum in RFC 6962, Section 3.2. Note that while in the current
     25   // RFC the STH and SCT share the versioning scheme, there are plans in
     26   // RFC6962-bis to use separate versions, so using a separate scheme here.
     27   enum Version { V1 = 0, };
     28 
     29   Version version;
     30   base::Time timestamp;
     31   uint64 tree_size;
     32   char sha256_root_hash[kSthRootHashLength];
     33   DigitallySigned signature;
     34 };
     35 
     36 }  // namespace ct
     37 
     38 }  // namespace net
     39 
     40 #endif
     41