Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: components/certificate_transparency/timestamped_leaf.h

Issue 2017563002: Add Certificate Transparency logs auditing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switching to TimestampedLeaf Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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 COMPONENTS_CERTIFICATE_TRANSPARENCY_TIMESTAMPED_LEAF_H_
6 #define COMPONENTS_CERTIFICATE_TRANSPARENCY_TIMESTAMPED_LEAF_H_
7
8 #include "base/optional.h"
9 #include "base/time/time.h"
10 #include "net/cert/merkle_tree_leaf.h"
Rob Percival 2016/06/30 14:15:58 #include <stdint.h> // for uint64_t
Eran Messeri 2016/06/30 19:58:28 Done.
11
12 class TimestampedLeaf {
Rob Percival 2016/06/30 14:15:58 It might be better to have this inherit from Merkl
Eran Messeri 2016/06/30 19:58:28 I'd rather keep it a separate class: - Detangling
13 public:
14 TimestampedLeaf(const net::ct::MerkleTreeLeaf& leaf,
15 const base::Time& seen_at);
16 TimestampedLeaf(const TimestampedLeaf& other);
17 ~TimestampedLeaf();
18
19 void SetLeafIndex(uint64_t index);
20 bool HasLeafIndex();
21 uint64_t GetLeafIndex();
Rob Percival 2016/06/30 14:15:58 HasLeafIndex() and GetLeafIndex() should be const.
Eran Messeri 2016/06/30 19:58:28 Done.
22 net::ct::MerkleTreeLeaf GetLeaf();
Rob Percival 2016/06/30 14:15:58 What's the point in having a non-const version of
Eran Messeri 2016/06/30 19:58:28 No point, removed.
23 const net::ct::MerkleTreeLeaf& GetLeaf() const;
24
25 private:
26 // The entire leaf for the certificate.
27 net::ct::MerkleTreeLeaf leaf_;
28 // When the leaf for the particular certificate was first seen.
29 base::Time first_seen_;
30 // The leaf's index in the tree. Only set if the index has been
31 // obtained from the log.
32 base::Optional<uint64_t> leaf_index_;
33 };
34
35 #endif // COMPONENTS_CERTIFICATE_TRANSPARENCY_TIMESTAMPED_LEAF_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698