Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / chromeos / attestation / fake_certificate.h
blob7481c8028c7702f0f3c46fde5a59b7949f2227ac
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.
5 #ifndef CHROME_BROWSER_CHROMEOS_ATTESTATION_FAKE_CERTIFICATE_H_
6 #define CHROME_BROWSER_CHROMEOS_ATTESTATION_FAKE_CERTIFICATE_H_
8 #include <string>
10 #include "base/time/time.h"
12 namespace chromeos {
13 namespace attestation {
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 GetFakeCertificateDER(const base::TimeDelta& expiry,
21 std::string* certificate);
23 // Similar to GetFakeCertificateDER but returns a PEM-encoded certificate.
24 bool GetFakeCertificatePEM(const base::TimeDelta& expiry,
25 std::string* certificate);
27 } // namespace attestation
28 } // namespace chromeos
30 #endif // CHROME_BROWSER_CHROMEOS_ATTESTATION_FAKE_CERTIFICATE_H_