Home | History | Annotate | Download | only in attestation
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_CHROMEOS_ATTESTATION_FAKE_CERTIFICATE_H_
      6 #define CHROME_BROWSER_CHROMEOS_ATTESTATION_FAKE_CERTIFICATE_H_
      7 
      8 #include <string>
      9 
     10 #include "base/time/time.h"
     11 
     12 namespace chromeos {
     13 namespace attestation {
     14 
     15 // Creates a self-signed |certificate| based on constant key material.  The
     16 // certificate |expiry| is relative to the current time.  The certificate will
     17 // be (or have been) valid from sometime before the current time or expiry,
     18 // whichever is first.  This is designed for use in unit tests and runs quickly.
     19 // Returns true on success.
     20 bool GetFakeCertificate(const base::TimeDelta& expiry,
     21                         std::string* certificate);
     22 
     23 }  // namespace attestation
     24 }  // namespace chromeos
     25 
     26 #endif  // CHROME_BROWSER_CHROMEOS_ATTESTATION_FAKE_CERTIFICATE_H_
     27