CRLiteTimestamp.h (1044B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef CRLiteTimestamp_h 8 #define CRLiteTimestamp_h 9 10 #include "nsICertStorage.h" 11 #include "SignedCertificateTimestamp.h" 12 13 namespace mozilla::psm { 14 15 class CRLiteTimestamp final : public nsICRLiteTimestamp { 16 public: 17 NS_DECL_ISUPPORTS 18 NS_DECL_NSICRLITETIMESTAMP 19 20 CRLiteTimestamp() : mTimestamp(0) {} 21 explicit CRLiteTimestamp(const ct::VerifiedSCT& vsct) 22 : mLogID(Span(vsct.sct.logId)), mTimestamp(vsct.sct.timestamp) {} 23 24 explicit CRLiteTimestamp(const ct::SignedCertificateTimestamp& sct) 25 : mLogID(Span(sct.logId)), mTimestamp(sct.timestamp) {} 26 27 private: 28 ~CRLiteTimestamp() = default; 29 30 nsTArray<uint8_t> mLogID; 31 uint64_t mTimestamp; 32 }; 33 34 } // namespace mozilla::psm 35 36 #endif // CRLiteTimestamp_h