aboutsummaryrefslogtreecommitdiff
path: root/x509util/testdata/data.go
blob: 832a3aa51fcaa35f1ecc82ed5536a6786342f254 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
package testdata

import (
	"bytes"
)

var (
	// EndEntityCertificate is a PEM-encoded end-entity certificate that is
	// signed by IntermediateCertificate
	EndEntityCertificate = []byte(`-----BEGIN CERTIFICATE-----
MIIBbDCCAR4CFDfeuu6XURfn7AE4WShuwZBHEaLIMAUGAytlcDBsMQswCQYDVQQG
EwJOQTELMAkGA1UECAwCTkExCzAJBgNVBAcMAk5BMQswCQYDVQQKDAJOQTELMAkG
A1UECwwCTkExFjAUBgNVBAMMDXN0ZmUgdGVzdGRhdGExETAPBgkqhkiG9w0BCQEW
Ak5BMB4XDTIwMTEwMzE4MzI0MFoXDTMyMDEyMTE4MzI0MFowRTELMAkGA1UEBhMC
QVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdp
dHMgUHR5IEx0ZDAqMAUGAytlcAMhAJvk390ZvwULplBri03Od4LLz+Sf/OUHu+20
wik+T9y5MAUGAytlcANBANekliXq4ttoClBJDZoktIQxyHHNcWyXFrj1HlOaT5bC
I3GIqqZ60Ua3jKytnEsKsD2rLMPItDwmG6wYSecy2ws=
-----END CERTIFICATE-----`)
	// EndEntityCertificateSerial is the serial number of EndEntityCertificate
	EndEntityCertificateSerial = "318961541902906095038704399034602270237826065096"
	// EndEntityPrivateKey is the PEM-encoded Ed25519 private key of EndEntityCertificate
	EndEntityPrivateKey = []byte(`-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIDme3WaCwW2/FX095yh02yIIsn0D3vbvN5NsJzcdUwq1
-----END PRIVATE KEY-----`)

	// EndEntityCertificate2 is a PEM-encoded end-entity certificate that
	// is signed by IntermediateCertificate2
	EndEntityCertificate2 = []byte(`-----BEGIN CERTIFICATE-----
MIIBbDCCAR4CFC4G5ep2NoHAmvFkmFID7y4U/BryMAUGAytlcDBsMQswCQYDVQQG
EwJOQTELMAkGA1UECAwCTkExCzAJBgNVBAcMAk5BMQswCQYDVQQKDAJOQTELMAkG
A1UECwwCTkExFjAUBgNVBAMMDXN0ZmUgdGVzdGRhdGExETAPBgkqhkiG9w0BCQEW
Ak5BMB4XDTIwMTEyNTIxNTkwM1oXDTMyMDIxMjIxNTkwM1owRTELMAkGA1UEBhMC
QVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdp
dHMgUHR5IEx0ZDAqMAUGAytlcAMhAKwG0O/Ql+L6O8aq8BZ+KOdJmVLdcnOmMENR
H7O84kVFMAUGAytlcANBAJIUg3wQ5AvhOaITYB/9rT5cm5dcklOdEIwAqvmSOEXf
vgCpSAz29bnKYJmjwp6mkXx3f31h39G41zr2wRjKnw8=
-----END CERTIFICATE-----`)
	// EndEntityCertificateSerial2 is the serial number of EndEntityCertificate2
	EndEntityCertificateSerial2 = "262767408425771953673235905171292083847897553650"
	// EndEntityPrivateKey2 is the PEM-encoded Ed25519 private key of EndEntityCertificate2
	EndEntityPrivateKey2 = []byte(`-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIH65lXoCT4N9q4mPmDcsmAqIqG9CrqrB4KV2nqBC9JlZ
-----END PRIVATE KEY-----`)

	// IntermediateCertificate is a PEM-encoded intermediate certificate that is
	// signed by RootCertificate
	IntermediateCertificate = []byte(`-----BEGIN CERTIFICATE-----
MIIB7jCCAaCgAwIBAgICEAAwBQYDK2VwMGwxCzAJBgNVBAYTAk5BMQswCQYDVQQI
DAJOQTELMAkGA1UEBwwCTkExCzAJBgNVBAoMAk5BMQswCQYDVQQLDAJOQTEWMBQG
A1UEAwwNc3RmZSB0ZXN0ZGF0YTERMA8GCSqGSIb3DQEJARYCTkEwHhcNMjAxMTAz
MTgzMjE4WhcNMzIwMTIxMTgzMjE4WjBsMQswCQYDVQQGEwJOQTELMAkGA1UECAwC
TkExCzAJBgNVBAcMAk5BMQswCQYDVQQKDAJOQTELMAkGA1UECwwCTkExFjAUBgNV
BAMMDXN0ZmUgdGVzdGRhdGExETAPBgkqhkiG9w0BCQEWAk5BMCowBQYDK2VwAyEA
F1yPPpjHKDAKN73pBFGXzAvIjdkLLimydu2y1HLMOiKjZjBkMB0GA1UdDgQWBBQ6
P7JQ7yXtrTh7YkVU0I78P9A+nDAfBgNVHSMEGDAWgBQBvsxROtKU6zmr/SxcfTMD
sAQcMTASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIChDAFBgMrZXAD
QQBm1GMV0ADPnXRWnelCW9tcyTh0p9hKefuSy/MNx7/XLHKnM5fX+yHqD84QOxES
Vc510vi4dM8I+e/vcoBsmMQP
-----END CERTIFICATE-----`)
	// IntermediateCertificateSerial is the serial number of IntermediateCertificate
	IntermediateCertificateSerial = "4096"
	// IntermediatePrivateKey is the PEM-encoded Ed25519 private key of IntermediateCertificate
	IntermediatePrivateKey = []byte(`-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIEiZEO5PnjkbN4A+5r9LVTIZeVdPq/on5AzwnetZjszE
-----END PRIVATE KEY-----`)
	// IntermediateChain is a PEM-encoded certificate chain that is composed
	// of an end-entity certificate and an intermediate certificate
	IntermediateChain = bytes.Join([][]byte{
		EndEntityCertificate,
		IntermediateCertificate,
	}, []byte("\n"))

	// IntermediateCertificate2 is a PEM-encoded intermediate certificate that
	// is signed by RootCertificate2
	IntermediateCertificate2 = []byte(`-----BEGIN CERTIFICATE-----
MIIB7jCCAaCgAwIBAgICEAAwBQYDK2VwMGwxCzAJBgNVBAYTAk5BMQswCQYDVQQI
DAJOQTELMAkGA1UEBwwCTkExCzAJBgNVBAoMAk5BMQswCQYDVQQLDAJOQTEWMBQG
A1UEAwwNc3RmZSB0ZXN0ZGF0YTERMA8GCSqGSIb3DQEJARYCTkEwHhcNMjAxMTI1
MjE1NzU1WhcNMzIwMjEyMjE1NzU1WjBsMQswCQYDVQQGEwJOQTELMAkGA1UECAwC
TkExCzAJBgNVBAcMAk5BMQswCQYDVQQKDAJOQTELMAkGA1UECwwCTkExFjAUBgNV
BAMMDXN0ZmUgdGVzdGRhdGExETAPBgkqhkiG9w0BCQEWAk5BMCowBQYDK2VwAyEA
DD23ESkuIKaCkU6xCncIwvD12w4ETBgAiHAubr/wDwujZjBkMB0GA1UdDgQWBBSy
uua2yvX+VM9JBc19GQisnLnH5zAfBgNVHSMEGDAWgBQeeImH1qUrWk+pq3YOkwI8
bWdEuTASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIChDAFBgMrZXAD
QQCoQvs8gPHZOH6VIuUGCcXVzf8D5+F6GZSoxMF880yYbdbUBVwwbJLFazwEn0uC
PwMBM9nZj3g1ZSH8uP2sEo0F
-----END CERTIFICATE-----`)
	// IntermediateCertificateSerial2 is the serial number of IntermediateCertificate2
	IntermediateCertificateSerial2 = "4096"
	// IntermediatePrivateKey2 is the PEM-encoded Ed25519 private key of IntermediateCertificate2
	IntermediatePrivateKey2 = []byte(`-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIOo+qcT2GoWoAp0079ecz/ZyrCZ78Zqznv1xEoN96vT7
-----END PRIVATE KEY-----`)
	// IntermediateChain2 is a PEM-encoded certificate chain that is composed
	// of an end-entity certificate and an intermediate certificate
	IntermediateChain2 = bytes.Join([][]byte{
		EndEntityCertificate2,
		IntermediateCertificate2,
	}, []byte("\n"))

	// RootCertificate is a PEM-encoded root certificate
	RootCertificate = []byte(`-----BEGIN CERTIFICATE-----
MIIB/TCCAa+gAwIBAgIUDYJzaC5VSkKwiLVAxO5MyphAkN8wBQYDK2VwMGwxCzAJ
BgNVBAYTAk5BMQswCQYDVQQIDAJOQTELMAkGA1UEBwwCTkExCzAJBgNVBAoMAk5B
MQswCQYDVQQLDAJOQTEWMBQGA1UEAwwNc3RmZSB0ZXN0ZGF0YTERMA8GCSqGSIb3
DQEJARYCTkEwHhcNMjAxMTAzMTgzMTMxWhcNMzIwMTIxMTgzMTMxWjBsMQswCQYD
VQQGEwJOQTELMAkGA1UECAwCTkExCzAJBgNVBAcMAk5BMQswCQYDVQQKDAJOQTEL
MAkGA1UECwwCTkExFjAUBgNVBAMMDXN0ZmUgdGVzdGRhdGExETAPBgkqhkiG9w0B
CQEWAk5BMCowBQYDK2VwAyEAJ1IiXCB4YHwdWka9MM0bc7LvKAtksmtIo8IhkuEB
uzGjYzBhMB0GA1UdDgQWBBQBvsxROtKU6zmr/SxcfTMDsAQcMTAfBgNVHSMEGDAW
gBQBvsxROtKU6zmr/SxcfTMDsAQcMTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB
/wQEAwIChDAFBgMrZXADQQCXh6kDnE5giTjcLET2S94qTwnHVAj57DJcR/rf9Jy8
NMGbtzTL0/V0B8DHuJFA/islbZJbN7rSvqddEKL8N2gI
-----END CERTIFICATE-----`)
	// RootCertificateSerial is the serial number of RootCertificate
	RootCertificateSerial = "77126030260354546250480693976417574174523953375"
	// RootPrivateKey is the PEM-encoded Ed25519 private key of RootCertificate
	RootPrivateKey = []byte(`-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIPJGy4Tf9SwDv44lLCmVyEjsbUmwfTg+j/Xoyaunf1rx
-----END PRIVATE KEY-----`)
	// RootChain is a PEM-encoded certificate chain that contains an end-entity
	// certificate, an intermediate certificate, and a root certificate.
	RootChain = bytes.Join([][]byte{
		EndEntityCertificate,
		IntermediateCertificate,
		RootCertificate,
	}, []byte("\n"))

	// RootCertificate2 is a PEM-encoded root certificate
	RootCertificate2 = []byte(`-----BEGIN CERTIFICATE-----
MIIB/TCCAa+gAwIBAgIUCFGFq5zAkH03LQ2fpAamPhGd8FgwBQYDK2VwMGwxCzAJ
BgNVBAYTAk5BMQswCQYDVQQIDAJOQTELMAkGA1UEBwwCTkExCzAJBgNVBAoMAk5B
MQswCQYDVQQLDAJOQTEWMBQGA1UEAwwNc3RmZSB0ZXN0ZGF0YTERMA8GCSqGSIb3
DQEJARYCTkEwHhcNMjAxMTE3MTgxNTQyWhcNMzIwMjA0MTgxNTQyWjBsMQswCQYD
VQQGEwJOQTELMAkGA1UECAwCTkExCzAJBgNVBAcMAk5BMQswCQYDVQQKDAJOQTEL
MAkGA1UECwwCTkExFjAUBgNVBAMMDXN0ZmUgdGVzdGRhdGExETAPBgkqhkiG9w0B
CQEWAk5BMCowBQYDK2VwAyEAFOG1Lof1UiV2mYsM17EopyVCR87qRrNW9YHP0biu
pOyjYzBhMB0GA1UdDgQWBBQeeImH1qUrWk+pq3YOkwI8bWdEuTAfBgNVHSMEGDAW
gBQeeImH1qUrWk+pq3YOkwI8bWdEuTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB
/wQEAwIChDAFBgMrZXADQQDP4IQePN5Krr7jn+RM8AbF+c4fXgamA1XDHVIfXy/n
MexxZMsuSCSDq5XM5GMImffmBXA1dNJ6ytfJi668C+kF
-----END CERTIFICATE-----`)
	// RootCertificateSerial2 is the serial number of RootCertificate2
	RootCertificateSerial2 = "47489930858344783188475742157087612794308522072"
	// RootPrivateKey2 is the PEM-encoded Ed25519 private key of RootCertificate2
	RootPrivateKey2 = []byte(`-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIKQd3B84w9pB6zJLGljuDyGKfz9uPP6QBeLiFcw0EME4
-----END PRIVATE KEY-----`)
	// RootChain2 is a PEM-encoded certificate chain that contains an end-entity
	// certificate, an intermediate certificate, and a root certificate.
	RootChain2 = bytes.Join([][]byte{
		EndEntityCertificate2,
		IntermediateCertificate2,
		RootCertificate2,
	}, []byte("\n"))
	
	// TrustAnchors is composed of two PEM-encoded trust anchors, namely,
	// RootCertificate and RootCertificate2.
	TrustAnchors = bytes.Join([][]byte{
		RootCertificate,
		RootCertificate2,
	}, []byte("\n"))
	// NumTrustAnchors is the number of test trust anchors
	NumTrustAnchors = 2

	// ExpiredCertificate is a PEM-encoded certificate that is always expired,
	// i.e., `Not Before`=`Not After`.  It is signed by IntermediateCertificate.
	ExpiredCertificate = []byte(`
-----BEGIN CERTIFICATE-----
MIIBbDCCAR4CFDfeuu6XURfn7AE4WShuwZBHEaLIMAUGAytlcDBsMQswCQYDVQQG
EwJOQTELMAkGA1UECAwCTkExCzAJBgNVBAcMAk5BMQswCQYDVQQKDAJOQTELMAkG
A1UECwwCTkExFjAUBgNVBAMMDXN0ZmUgdGVzdGRhdGExETAPBgkqhkiG9w0BCQEW
Ak5BMB4XDTIwMTEwMzE4MzI0MFoXDTMyMDEyMTE4MzI0MFowRTELMAkGA1UEBhMC
QVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdp
dHMgUHR5IEx0ZDAqMAUGAytlcAMhAJvk390ZvwULplBri03Od4LLz+Sf/OUHu+20
wik+T9y5MAUGAytlcANBANekliXq4ttoClBJDZoktIQxyHHNcWyXFrj1HlOaT5bC
I3GIqqZ60Ua3jKytnEsKsD2rLMPItDwmG6wYSecy2ws=
-----END CERTIFICATE-----`)
	// ExpiredChain is an expired PEM-encoded certificate chain.  It is composed
	// of two certificates: ExpiredCertificate and IntermediateCertificate.
	ExpiredChain = bytes.Join([][]byte{
		ExpiredCertificate,
		IntermediateCertificate,
	}, []byte("\n"))

	// ChainBadIntermediate is a PEM-encoded certificate chain that contains
	// an end-entity certificate, an intermediate certificate, and a root
	// certificate.  However, the intermediate does not sign the end-entity.
	ChainBadIntermediate = bytes.Join([][]byte{
		EndEntityCertificate,
		IntermediateCertificate2,
		RootCertificate2,
	}, []byte("\n"))

	// ChainBadRoot is a PEM-encoded certificate chain that contains an
	// end-entity certificate, an intermediate certificate, and a root
	// certificate.  However, the root does not sign the intermediate.
	ChainBadRoot = bytes.Join([][]byte{
		EndEntityCertificate,
		IntermediateCertificate,
		RootCertificate2,
	}, []byte("\n"))

	// TruncatedCertificate is a truncated PEM-encoded certificate
	TruncatedCertificate = []byte(`-----BEGIN CERTIFICATE-----
MIIBbDCCAR4CFDfeuu6XURfn7AE4WShuwZBHEaLIMAUGAytlcDBsMQswCQYDVQQG
-----END CERTIFICATE-----`)

	// NotACertificate is a PEM-encoded certificate block that contains an
	// Ed25519 private key
	NotACertificate = []byte(`-----BEGIN CERTIFICATE-----
MC4CAQAwBQYDK2VwBCIEIH65lXoCT4N9q4mPmDcsmAqIqG9CrqrB4KV2nqBC9JlZ
-----END CERTIFICATE-----`)

	// NotEd25519PrivateKey is a PEM-encoded ECDSA private key
	NotEd25519PrivateKey = []byte(`-----BEGIN PRIVATE KEY-----
MIHcAgEBBEIAtxq7RExTFraqJYhyedPFppJiV05tXb1gxmn+9DGNsfmZ5aD2ZwDo
PoIVDYudwj7gDL4MXzJj7LUh6WW0qALm4MugBwYFK4EEACOhgYkDgYYABAAcg0Y3
WTBxfVuw/OPdLf65N6hmBoCGgW8DOhfRXtZNzqkf3u1LnNpWrt/Xva7K6uthvLRr
A3djeuCmg8MlHdtFYQDa9QSsc0ZBhp6Lg7JSED8nopQIvKPocsUejqJVDqJ4ZK1E
+2qB5BQl9vGLUpZ5HKkWvKvo8jpNbstVyeOFtvLfGg==
-----END PRIVATE KEY-----`)

	// TruncatedEd25519PrivateKey is a a PEM-encoded Ed25519 private key that
	// has a truncated block
	TruncatedEd25519PrivateKey = []byte(`-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIH6
-----END PRIVATE KEY-----`)

	// DoubleEd25519PrivateKey is composed of two PEM-encoded Ed25519 private
	// keys
	DoubleEd25519PrivateKey = bytes.Join([][]byte{
		EndEntityPrivateKey,
		EndEntityPrivateKey2,
	}, []byte("\n"))

	// Ed25519PrivateKeyBadWhiteSpace is a PEM-encoded Ed25519 private key that
	// contains unwanted white space
	Ed25519PrivateKeyBadWhiteSpace = []byte(`
		-----BEGIN PRIVATE KEY-----
		MC4CAQAwBQYDK2VwBCIEIH65lXoCT4N9q4mPmDcsmAqIqG9CrqrB4KV2nqBC9JlZ
		-----END PRIVATE KEY-----`)

	// CertificateBadWhiteSpace is a PEM-encoded certificate that contains
	// unwanted white space
	CertificateBadWhiteSpace = []byte(`
		-----BEGIN CERTIFICATE-----
		MIIBbDCCAR4CFDfeuu6XURfn7AE4WShuwZBHEaLIMAUGAytlcDBsMQswCQYDVQQG
		EwJOQTELMAkGA1UECAwCTkExCzAJBgNVBAcMAk5BMQswCQYDVQQKDAJOQTELMAkG
		A1UECwwCTkExFjAUBgNVBAMMDXN0ZmUgdGVzdGRhdGExETAPBgkqhkiG9w0BCQEW
		Ak5BMB4XDTIwMTEwMzE4MzI0MFoXDTMyMDEyMTE4MzI0MFowRTELMAkGA1UEBhMC
		QVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdp
		dHMgUHR5IEx0ZDAqMAUGAytlcAMhAJvk390ZvwULplBri03Od4LLz+Sf/OUHu+20
		wik+T9y5MAUGAytlcANBANekliXq4ttoClBJDZoktIQxyHHNcWyXFrj1HlOaT5bC
		I3GIqqZ60Ua3jKytnEsKsD2rLMPItDwmG6wYSecy2ws=
		-----END CERTIFICATE-----`)
)