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 NET_CERT_CT_TEST_UTIL_H_
6 #define NET_CERT_CT_TEST_UTIL_H_
10 #include "base/memory/ref_counted.h"
17 struct SignedCertificateTimestamp
;
18 struct SignedTreeHead
;
20 // Note: unless specified otherwise, all test data is taken from Certificate
21 // Transparency test data repository.
23 // Fills |entry| with test data for an X.509 entry.
24 void GetX509CertLogEntry(LogEntry
* entry
);
26 // Returns a DER-encoded X509 cert. The SCT provided by
27 // GetX509CertSCT is signed over this certificate.
28 std::string
GetDerEncodedX509Cert();
30 // Fills |entry| with test data for a Precertificate entry.
31 void GetPrecertLogEntry(LogEntry
* entry
);
33 // Returns the binary representation of a test DigitallySigned
34 std::string
GetTestDigitallySigned();
36 // Returns the binary representation of a test serialized SCT.
37 std::string
GetTestSignedCertificateTimestamp();
40 std::string
GetTestPublicKey();
43 std::string
GetTestPublicKeyId();
45 // SCT for the X509Certificate provided above.
46 void GetX509CertSCT(scoped_refptr
<SignedCertificateTimestamp
>* sct
);
48 // SCT for the Precertificate log entry provided above.
49 void GetPrecertSCT(scoped_refptr
<SignedCertificateTimestamp
>* sct
);
52 std::string
GetDefaultIssuerKeyHash();
54 // Fake OCSP response with an embedded SCT list.
55 std::string
GetDerEncodedFakeOCSPResponse();
57 // The SCT list embedded in the response above.
58 std::string
GetFakeOCSPExtensionValue();
60 // The cert the OCSP response is for.
61 std::string
GetDerEncodedFakeOCSPResponseCert();
63 // The issuer of the previous cert.
64 std::string
GetDerEncodedFakeOCSPResponseIssuerCert();
66 // A sample, valid STH
67 void GetSignedTreeHead(SignedTreeHead
* sth
);
69 // The SHA256 root hash for the sample STH
70 std::string
GetSampleSTHSHA256RootHash();
76 #endif // NET_CERT_CT_TEST_UTIL_H_