blob: e8f929f068d60deeaafb2a372db3170674646396 [file] [log] [blame]
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
#include "base/time/time.h"
namespace ash {
namespace attestation {
// Creates a self-signed |certificate| based on constant key material. The
// certificate |expiry| is relative to the current time. The certificate will
// be (or have been) valid from sometime before the current time or expiry,
// whichever is first. This is designed for use in unit tests and runs quickly.
// Returns true on success.
bool GetFakeCertificateDER(const base::TimeDelta& expiry,
std::string* certificate);
// Similar to GetFakeCertificateDER but returns a PEM-encoded certificate.
bool GetFakeCertificatePEM(const base::TimeDelta& expiry,
std::string* certificate);
} // namespace attestation
} // namespace ash