ct_test_util.h revision f2477e01787aa58f445919b809d89e252beef54f
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 NET_CERT_CT_TEST_UTIL_H_
6#define NET_CERT_CT_TEST_UTIL_H_
7
8#include <string>
9
10#include "base/memory/ref_counted.h"
11
12namespace net {
13
14namespace ct {
15
16struct LogEntry;
17struct SignedCertificateTimestamp;
18
19// Note: unless specified otherwise, all test data is taken from Certificate
20// Transparency test data repository.
21
22// Fills |entry| with test data for an X.509 entry.
23void GetX509CertLogEntry(LogEntry* entry);
24
25// Returns a DER-encoded X509 cert. The SCT provided by
26// GetX509CertSCT is signed over this certificate.
27std::string GetDerEncodedX509Cert();
28
29// Fills |entry| with test data for a Precertificate entry.
30void GetPrecertLogEntry(LogEntry* entry);
31
32// Returns the binary representation of a test DigitallySigned
33std::string GetTestDigitallySigned();
34
35// Returns the binary representation of a test serialized SCT.
36std::string GetTestSignedCertificateTimestamp();
37
38// Test log key
39std::string GetTestPublicKey();
40
41// ID of test log key
42std::string GetTestPublicKeyId();
43
44// SCT for the X509Certificate provided above.
45void GetX509CertSCT(scoped_refptr<SignedCertificateTimestamp>* sct);
46
47// SCT for the Precertificate log entry provided above.
48void GetPrecertSCT(scoped_refptr<SignedCertificateTimestamp>* sct);
49
50// Issuer key hash
51std::string GetDefaultIssuerKeyHash();
52
53}  // namespace ct
54
55}  // namespace net
56
57#endif  // NET_CERT_CT_TEST_UTIL_H_
58