libgo: Merge from revision 18783:00cce3a34d7e of master library.
[official-gcc.git] / libgo / go / encoding / asn1 / asn1_test.go
blobea98e023faf20badfec5caa5f0cc2f8411f5957d
1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 package asn1
7 import (
8 "bytes"
9 "fmt"
10 "math/big"
11 "reflect"
12 "testing"
13 "time"
16 type boolTest struct {
17 in []byte
18 ok bool
19 out bool
22 var boolTestData = []boolTest{
23 {[]byte{0x00}, true, false},
24 {[]byte{0xff}, true, true},
25 {[]byte{0x00, 0x00}, false, false},
26 {[]byte{0xff, 0xff}, false, false},
27 {[]byte{0x01}, false, false},
30 func TestParseBool(t *testing.T) {
31 for i, test := range boolTestData {
32 ret, err := parseBool(test.in)
33 if (err == nil) != test.ok {
34 t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok)
36 if test.ok && ret != test.out {
37 t.Errorf("#%d: Bad result: %v (expected %v)", i, ret, test.out)
42 type int64Test struct {
43 in []byte
44 ok bool
45 out int64
48 var int64TestData = []int64Test{
49 {[]byte{0x00}, true, 0},
50 {[]byte{0x7f}, true, 127},
51 {[]byte{0x00, 0x80}, true, 128},
52 {[]byte{0x01, 0x00}, true, 256},
53 {[]byte{0x80}, true, -128},
54 {[]byte{0xff, 0x7f}, true, -129},
55 {[]byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, true, -1},
56 {[]byte{0xff}, true, -1},
57 {[]byte{0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, true, -9223372036854775808},
58 {[]byte{0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, false, 0},
61 func TestParseInt64(t *testing.T) {
62 for i, test := range int64TestData {
63 ret, err := parseInt64(test.in)
64 if (err == nil) != test.ok {
65 t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok)
67 if test.ok && ret != test.out {
68 t.Errorf("#%d: Bad result: %v (expected %v)", i, ret, test.out)
73 type int32Test struct {
74 in []byte
75 ok bool
76 out int32
79 var int32TestData = []int32Test{
80 {[]byte{0x00}, true, 0},
81 {[]byte{0x7f}, true, 127},
82 {[]byte{0x00, 0x80}, true, 128},
83 {[]byte{0x01, 0x00}, true, 256},
84 {[]byte{0x80}, true, -128},
85 {[]byte{0xff, 0x7f}, true, -129},
86 {[]byte{0xff, 0xff, 0xff, 0xff}, true, -1},
87 {[]byte{0xff}, true, -1},
88 {[]byte{0x80, 0x00, 0x00, 0x00}, true, -2147483648},
89 {[]byte{0x80, 0x00, 0x00, 0x00, 0x00}, false, 0},
92 func TestParseInt32(t *testing.T) {
93 for i, test := range int32TestData {
94 ret, err := parseInt32(test.in)
95 if (err == nil) != test.ok {
96 t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok)
98 if test.ok && int32(ret) != test.out {
99 t.Errorf("#%d: Bad result: %v (expected %v)", i, ret, test.out)
104 var bigIntTests = []struct {
105 in []byte
106 base10 string
108 {[]byte{0xff}, "-1"},
109 {[]byte{0x00}, "0"},
110 {[]byte{0x01}, "1"},
111 {[]byte{0x00, 0xff}, "255"},
112 {[]byte{0xff, 0x00}, "-256"},
113 {[]byte{0x01, 0x00}, "256"},
116 func TestParseBigInt(t *testing.T) {
117 for i, test := range bigIntTests {
118 ret := parseBigInt(test.in)
119 if ret.String() != test.base10 {
120 t.Errorf("#%d: bad result from %x, got %s want %s", i, test.in, ret.String(), test.base10)
122 fw := newForkableWriter()
123 marshalBigInt(fw, ret)
124 result := fw.Bytes()
125 if !bytes.Equal(result, test.in) {
126 t.Errorf("#%d: got %x from marshaling %s, want %x", i, result, ret, test.in)
131 type bitStringTest struct {
132 in []byte
133 ok bool
134 out []byte
135 bitLength int
138 var bitStringTestData = []bitStringTest{
139 {[]byte{}, false, []byte{}, 0},
140 {[]byte{0x00}, true, []byte{}, 0},
141 {[]byte{0x07, 0x00}, true, []byte{0x00}, 1},
142 {[]byte{0x07, 0x01}, false, []byte{}, 0},
143 {[]byte{0x07, 0x40}, false, []byte{}, 0},
144 {[]byte{0x08, 0x00}, false, []byte{}, 0},
147 func TestBitString(t *testing.T) {
148 for i, test := range bitStringTestData {
149 ret, err := parseBitString(test.in)
150 if (err == nil) != test.ok {
151 t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok)
153 if err == nil {
154 if test.bitLength != ret.BitLength || !bytes.Equal(ret.Bytes, test.out) {
155 t.Errorf("#%d: Bad result: %v (expected %v %v)", i, ret, test.out, test.bitLength)
161 func TestBitStringAt(t *testing.T) {
162 bs := BitString{[]byte{0x82, 0x40}, 16}
163 if bs.At(0) != 1 {
164 t.Error("#1: Failed")
166 if bs.At(1) != 0 {
167 t.Error("#2: Failed")
169 if bs.At(6) != 1 {
170 t.Error("#3: Failed")
172 if bs.At(9) != 1 {
173 t.Error("#4: Failed")
175 if bs.At(-1) != 0 {
176 t.Error("#5: Failed")
178 if bs.At(17) != 0 {
179 t.Error("#6: Failed")
183 type bitStringRightAlignTest struct {
184 in []byte
185 inlen int
186 out []byte
189 var bitStringRightAlignTests = []bitStringRightAlignTest{
190 {[]byte{0x80}, 1, []byte{0x01}},
191 {[]byte{0x80, 0x80}, 9, []byte{0x01, 0x01}},
192 {[]byte{}, 0, []byte{}},
193 {[]byte{0xce}, 8, []byte{0xce}},
194 {[]byte{0xce, 0x47}, 16, []byte{0xce, 0x47}},
195 {[]byte{0x34, 0x50}, 12, []byte{0x03, 0x45}},
198 func TestBitStringRightAlign(t *testing.T) {
199 for i, test := range bitStringRightAlignTests {
200 bs := BitString{test.in, test.inlen}
201 out := bs.RightAlign()
202 if !bytes.Equal(out, test.out) {
203 t.Errorf("#%d got: %x want: %x", i, out, test.out)
208 type objectIdentifierTest struct {
209 in []byte
210 ok bool
211 out []int
214 var objectIdentifierTestData = []objectIdentifierTest{
215 {[]byte{}, false, []int{}},
216 {[]byte{85}, true, []int{2, 5}},
217 {[]byte{85, 0x02}, true, []int{2, 5, 2}},
218 {[]byte{85, 0x02, 0xc0, 0x00}, true, []int{2, 5, 2, 0x2000}},
219 {[]byte{0x81, 0x34, 0x03}, true, []int{2, 100, 3}},
220 {[]byte{85, 0x02, 0xc0, 0x80, 0x80, 0x80, 0x80}, false, []int{}},
223 func TestObjectIdentifier(t *testing.T) {
224 for i, test := range objectIdentifierTestData {
225 ret, err := parseObjectIdentifier(test.in)
226 if (err == nil) != test.ok {
227 t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok)
229 if err == nil {
230 if !reflect.DeepEqual(test.out, ret) {
231 t.Errorf("#%d: Bad result: %v (expected %v)", i, ret, test.out)
237 type timeTest struct {
238 in string
239 ok bool
240 out time.Time
243 var utcTestData = []timeTest{
244 {"910506164540-0700", true, time.Date(1991, 05, 06, 16, 45, 40, 0, time.FixedZone("", -7*60*60))},
245 {"910506164540+0730", true, time.Date(1991, 05, 06, 16, 45, 40, 0, time.FixedZone("", 7*60*60+30*60))},
246 {"910506234540Z", true, time.Date(1991, 05, 06, 23, 45, 40, 0, time.UTC)},
247 {"9105062345Z", true, time.Date(1991, 05, 06, 23, 45, 0, 0, time.UTC)},
248 {"5105062345Z", true, time.Date(1951, 05, 06, 23, 45, 0, 0, time.UTC)},
249 {"a10506234540Z", false, time.Time{}},
250 {"91a506234540Z", false, time.Time{}},
251 {"9105a6234540Z", false, time.Time{}},
252 {"910506a34540Z", false, time.Time{}},
253 {"910506334a40Z", false, time.Time{}},
254 {"91050633444aZ", false, time.Time{}},
255 {"910506334461Z", false, time.Time{}},
256 {"910506334400Za", false, time.Time{}},
259 func TestUTCTime(t *testing.T) {
260 for i, test := range utcTestData {
261 ret, err := parseUTCTime([]byte(test.in))
262 if err != nil {
263 if test.ok {
264 t.Errorf("#%d: parseUTCTime(%q) = error %v", i, test.in, err)
266 continue
268 if !test.ok {
269 t.Errorf("#%d: parseUTCTime(%q) succeeded, should have failed", i, test.in)
270 continue
272 const format = "Jan _2 15:04:05 -0700 2006" // ignore zone name, just offset
273 have := ret.Format(format)
274 want := test.out.Format(format)
275 if have != want {
276 t.Errorf("#%d: parseUTCTime(%q) = %s, want %s", i, test.in, have, want)
281 var generalizedTimeTestData = []timeTest{
282 {"20100102030405Z", true, time.Date(2010, 01, 02, 03, 04, 05, 0, time.UTC)},
283 {"20100102030405", false, time.Time{}},
284 {"20100102030405+0607", true, time.Date(2010, 01, 02, 03, 04, 05, 0, time.FixedZone("", 6*60*60+7*60))},
285 {"20100102030405-0607", true, time.Date(2010, 01, 02, 03, 04, 05, 0, time.FixedZone("", -6*60*60-7*60))},
288 func TestGeneralizedTime(t *testing.T) {
289 for i, test := range generalizedTimeTestData {
290 ret, err := parseGeneralizedTime([]byte(test.in))
291 if (err == nil) != test.ok {
292 t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok)
294 if err == nil {
295 if !reflect.DeepEqual(test.out, ret) {
296 t.Errorf("#%d: Bad result: %v (expected %v)", i, ret, test.out)
302 type tagAndLengthTest struct {
303 in []byte
304 ok bool
305 out tagAndLength
308 var tagAndLengthData = []tagAndLengthTest{
309 {[]byte{0x80, 0x01}, true, tagAndLength{2, 0, 1, false}},
310 {[]byte{0xa0, 0x01}, true, tagAndLength{2, 0, 1, true}},
311 {[]byte{0x02, 0x00}, true, tagAndLength{0, 2, 0, false}},
312 {[]byte{0xfe, 0x00}, true, tagAndLength{3, 30, 0, true}},
313 {[]byte{0x1f, 0x01, 0x00}, true, tagAndLength{0, 1, 0, false}},
314 {[]byte{0x1f, 0x81, 0x00, 0x00}, true, tagAndLength{0, 128, 0, false}},
315 {[]byte{0x1f, 0x81, 0x80, 0x01, 0x00}, true, tagAndLength{0, 0x4001, 0, false}},
316 {[]byte{0x00, 0x81, 0x01}, true, tagAndLength{0, 0, 1, false}},
317 {[]byte{0x00, 0x82, 0x01, 0x00}, true, tagAndLength{0, 0, 256, false}},
318 {[]byte{0x00, 0x83, 0x01, 0x00}, false, tagAndLength{}},
319 {[]byte{0x1f, 0x85}, false, tagAndLength{}},
320 {[]byte{0x30, 0x80}, false, tagAndLength{}},
321 // Superfluous zeros in the length should be an error.
322 {[]byte{0xa0, 0x82, 0x00, 0x01}, false, tagAndLength{}},
323 // Lengths up to the maximum size of an int should work.
324 {[]byte{0xa0, 0x84, 0x7f, 0xff, 0xff, 0xff}, true, tagAndLength{2, 0, 0x7fffffff, true}},
325 // Lengths that would overflow an int should be rejected.
326 {[]byte{0xa0, 0x84, 0x80, 0x00, 0x00, 0x00}, false, tagAndLength{}},
329 func TestParseTagAndLength(t *testing.T) {
330 for i, test := range tagAndLengthData {
331 tagAndLength, _, err := parseTagAndLength(test.in, 0)
332 if (err == nil) != test.ok {
333 t.Errorf("#%d: Incorrect error result (did pass? %v, expected: %v)", i, err == nil, test.ok)
335 if err == nil && !reflect.DeepEqual(test.out, tagAndLength) {
336 t.Errorf("#%d: Bad result: %v (expected %v)", i, tagAndLength, test.out)
341 type parseFieldParametersTest struct {
342 in string
343 out fieldParameters
346 func newInt(n int) *int { return &n }
348 func newInt64(n int64) *int64 { return &n }
350 func newString(s string) *string { return &s }
352 func newBool(b bool) *bool { return &b }
354 var parseFieldParametersTestData []parseFieldParametersTest = []parseFieldParametersTest{
355 {"", fieldParameters{}},
356 {"ia5", fieldParameters{stringType: tagIA5String}},
357 {"printable", fieldParameters{stringType: tagPrintableString}},
358 {"optional", fieldParameters{optional: true}},
359 {"explicit", fieldParameters{explicit: true, tag: new(int)}},
360 {"application", fieldParameters{application: true, tag: new(int)}},
361 {"optional,explicit", fieldParameters{optional: true, explicit: true, tag: new(int)}},
362 {"default:42", fieldParameters{defaultValue: newInt64(42)}},
363 {"tag:17", fieldParameters{tag: newInt(17)}},
364 {"optional,explicit,default:42,tag:17", fieldParameters{optional: true, explicit: true, defaultValue: newInt64(42), tag: newInt(17)}},
365 {"optional,explicit,default:42,tag:17,rubbish1", fieldParameters{true, true, false, newInt64(42), newInt(17), 0, false, false}},
366 {"set", fieldParameters{set: true}},
369 func TestParseFieldParameters(t *testing.T) {
370 for i, test := range parseFieldParametersTestData {
371 f := parseFieldParameters(test.in)
372 if !reflect.DeepEqual(f, test.out) {
373 t.Errorf("#%d: Bad result: %v (expected %v)", i, f, test.out)
378 type TestObjectIdentifierStruct struct {
379 OID ObjectIdentifier
382 type TestContextSpecificTags struct {
383 A int `asn1:"tag:1"`
386 type TestContextSpecificTags2 struct {
387 A int `asn1:"explicit,tag:1"`
388 B int
391 type TestElementsAfterString struct {
392 S string
393 A, B int
396 type TestBigInt struct {
397 X *big.Int
400 var unmarshalTestData = []struct {
401 in []byte
402 out interface{}
404 {[]byte{0x02, 0x01, 0x42}, newInt(0x42)},
405 {[]byte{0x30, 0x08, 0x06, 0x06, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d}, &TestObjectIdentifierStruct{[]int{1, 2, 840, 113549}}},
406 {[]byte{0x03, 0x04, 0x06, 0x6e, 0x5d, 0xc0}, &BitString{[]byte{110, 93, 192}, 18}},
407 {[]byte{0x30, 0x09, 0x02, 0x01, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, 0x03}, &[]int{1, 2, 3}},
408 {[]byte{0x02, 0x01, 0x10}, newInt(16)},
409 {[]byte{0x13, 0x04, 't', 'e', 's', 't'}, newString("test")},
410 {[]byte{0x16, 0x04, 't', 'e', 's', 't'}, newString("test")},
411 {[]byte{0x16, 0x04, 't', 'e', 's', 't'}, &RawValue{0, 22, false, []byte("test"), []byte("\x16\x04test")}},
412 {[]byte{0x04, 0x04, 1, 2, 3, 4}, &RawValue{0, 4, false, []byte{1, 2, 3, 4}, []byte{4, 4, 1, 2, 3, 4}}},
413 {[]byte{0x30, 0x03, 0x81, 0x01, 0x01}, &TestContextSpecificTags{1}},
414 {[]byte{0x30, 0x08, 0xa1, 0x03, 0x02, 0x01, 0x01, 0x02, 0x01, 0x02}, &TestContextSpecificTags2{1, 2}},
415 {[]byte{0x01, 0x01, 0x00}, newBool(false)},
416 {[]byte{0x01, 0x01, 0xff}, newBool(true)},
417 {[]byte{0x30, 0x0b, 0x13, 0x03, 0x66, 0x6f, 0x6f, 0x02, 0x01, 0x22, 0x02, 0x01, 0x33}, &TestElementsAfterString{"foo", 0x22, 0x33}},
418 {[]byte{0x30, 0x05, 0x02, 0x03, 0x12, 0x34, 0x56}, &TestBigInt{big.NewInt(0x123456)}},
421 func TestUnmarshal(t *testing.T) {
422 for i, test := range unmarshalTestData {
423 pv := reflect.New(reflect.TypeOf(test.out).Elem())
424 val := pv.Interface()
425 _, err := Unmarshal(test.in, val)
426 if err != nil {
427 t.Errorf("Unmarshal failed at index %d %v", i, err)
429 if !reflect.DeepEqual(val, test.out) {
430 t.Errorf("#%d:\nhave %#v\nwant %#v", i, val, test.out)
435 type Certificate struct {
436 TBSCertificate TBSCertificate
437 SignatureAlgorithm AlgorithmIdentifier
438 SignatureValue BitString
441 type TBSCertificate struct {
442 Version int `asn1:"optional,explicit,default:0,tag:0"`
443 SerialNumber RawValue
444 SignatureAlgorithm AlgorithmIdentifier
445 Issuer RDNSequence
446 Validity Validity
447 Subject RDNSequence
448 PublicKey PublicKeyInfo
451 type AlgorithmIdentifier struct {
452 Algorithm ObjectIdentifier
455 type RDNSequence []RelativeDistinguishedNameSET
457 type RelativeDistinguishedNameSET []AttributeTypeAndValue
459 type AttributeTypeAndValue struct {
460 Type ObjectIdentifier
461 Value interface{}
464 type Validity struct {
465 NotBefore, NotAfter time.Time
468 type PublicKeyInfo struct {
469 Algorithm AlgorithmIdentifier
470 PublicKey BitString
473 func TestCertificate(t *testing.T) {
474 // This is a minimal, self-signed certificate that should parse correctly.
475 var cert Certificate
476 if _, err := Unmarshal(derEncodedSelfSignedCertBytes, &cert); err != nil {
477 t.Errorf("Unmarshal failed: %v", err)
479 if !reflect.DeepEqual(cert, derEncodedSelfSignedCert) {
480 t.Errorf("Bad result:\ngot: %+v\nwant: %+v", cert, derEncodedSelfSignedCert)
484 func TestCertificateWithNUL(t *testing.T) {
485 // This is the paypal NUL-hack certificate. It should fail to parse because
486 // NUL isn't a permitted character in a PrintableString.
488 var cert Certificate
489 if _, err := Unmarshal(derEncodedPaypalNULCertBytes, &cert); err == nil {
490 t.Error("Unmarshal succeeded, should not have")
494 type rawStructTest struct {
495 Raw RawContent
496 A int
499 func TestRawStructs(t *testing.T) {
500 var s rawStructTest
501 input := []byte{0x30, 0x03, 0x02, 0x01, 0x50}
503 rest, err := Unmarshal(input, &s)
504 if len(rest) != 0 {
505 t.Errorf("incomplete parse: %x", rest)
506 return
508 if err != nil {
509 t.Error(err)
510 return
512 if s.A != 0x50 {
513 t.Errorf("bad value for A: got %d want %d", s.A, 0x50)
515 if !bytes.Equal([]byte(s.Raw), input) {
516 t.Errorf("bad value for Raw: got %x want %x", s.Raw, input)
520 type oiEqualTest struct {
521 first ObjectIdentifier
522 second ObjectIdentifier
523 same bool
526 var oiEqualTests = []oiEqualTest{
528 ObjectIdentifier{1, 2, 3},
529 ObjectIdentifier{1, 2, 3},
530 true,
533 ObjectIdentifier{1},
534 ObjectIdentifier{1, 2, 3},
535 false,
538 ObjectIdentifier{1, 2, 3},
539 ObjectIdentifier{10, 11, 12},
540 false,
544 func TestObjectIdentifierEqual(t *testing.T) {
545 for _, o := range oiEqualTests {
546 if s := o.first.Equal(o.second); s != o.same {
547 t.Errorf("ObjectIdentifier.Equal: got: %t want: %t", s, o.same)
552 var derEncodedSelfSignedCert = Certificate{
553 TBSCertificate: TBSCertificate{
554 Version: 0,
555 SerialNumber: RawValue{Class: 0, Tag: 2, IsCompound: false, Bytes: []uint8{0x0, 0x8c, 0xc3, 0x37, 0x92, 0x10, 0xec, 0x2c, 0x98}, FullBytes: []byte{2, 9, 0x0, 0x8c, 0xc3, 0x37, 0x92, 0x10, 0xec, 0x2c, 0x98}},
556 SignatureAlgorithm: AlgorithmIdentifier{Algorithm: ObjectIdentifier{1, 2, 840, 113549, 1, 1, 5}},
557 Issuer: RDNSequence{
558 RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 6}, Value: "XX"}},
559 RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 8}, Value: "Some-State"}},
560 RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 7}, Value: "City"}},
561 RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 10}, Value: "Internet Widgits Pty Ltd"}},
562 RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 3}, Value: "false.example.com"}},
563 RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{1, 2, 840, 113549, 1, 9, 1}, Value: "false@example.com"}},
565 Validity: Validity{
566 NotBefore: time.Date(2009, 10, 8, 00, 25, 53, 0, time.UTC),
567 NotAfter: time.Date(2010, 10, 8, 00, 25, 53, 0, time.UTC),
569 Subject: RDNSequence{
570 RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 6}, Value: "XX"}},
571 RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 8}, Value: "Some-State"}},
572 RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 7}, Value: "City"}},
573 RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 10}, Value: "Internet Widgits Pty Ltd"}},
574 RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 3}, Value: "false.example.com"}},
575 RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{1, 2, 840, 113549, 1, 9, 1}, Value: "false@example.com"}},
577 PublicKey: PublicKeyInfo{
578 Algorithm: AlgorithmIdentifier{Algorithm: ObjectIdentifier{1, 2, 840, 113549, 1, 1, 1}},
579 PublicKey: BitString{
580 Bytes: []uint8{
581 0x30, 0x48, 0x2, 0x41, 0x0, 0xcd, 0xb7,
582 0x63, 0x9c, 0x32, 0x78, 0xf0, 0x6, 0xaa, 0x27, 0x7f, 0x6e, 0xaf, 0x42,
583 0x90, 0x2b, 0x59, 0x2d, 0x8c, 0xbc, 0xbe, 0x38, 0xa1, 0xc9, 0x2b, 0xa4,
584 0x69, 0x5a, 0x33, 0x1b, 0x1d, 0xea, 0xde, 0xad, 0xd8, 0xe9, 0xa5, 0xc2,
585 0x7e, 0x8c, 0x4c, 0x2f, 0xd0, 0xa8, 0x88, 0x96, 0x57, 0x72, 0x2a, 0x4f,
586 0x2a, 0xf7, 0x58, 0x9c, 0xf2, 0xc7, 0x70, 0x45, 0xdc, 0x8f, 0xde, 0xec,
587 0x35, 0x7d, 0x2, 0x3, 0x1, 0x0, 0x1,
589 BitLength: 592,
593 SignatureAlgorithm: AlgorithmIdentifier{Algorithm: ObjectIdentifier{1, 2, 840, 113549, 1, 1, 5}},
594 SignatureValue: BitString{
595 Bytes: []uint8{
596 0xa6, 0x7b, 0x6, 0xec, 0x5e, 0xce,
597 0x92, 0x77, 0x2c, 0xa4, 0x13, 0xcb, 0xa3, 0xca, 0x12, 0x56, 0x8f, 0xdc, 0x6c,
598 0x7b, 0x45, 0x11, 0xcd, 0x40, 0xa7, 0xf6, 0x59, 0x98, 0x4, 0x2, 0xdf, 0x2b,
599 0x99, 0x8b, 0xb9, 0xa4, 0xa8, 0xcb, 0xeb, 0x34, 0xc0, 0xf0, 0xa7, 0x8c, 0xf8,
600 0xd9, 0x1e, 0xde, 0x14, 0xa5, 0xed, 0x76, 0xbf, 0x11, 0x6f, 0xe3, 0x60, 0xaa,
601 0xfa, 0x88, 0x21, 0x49, 0x4, 0x35,
603 BitLength: 512,
607 var derEncodedSelfSignedCertBytes = []byte{
608 0x30, 0x82, 0x02, 0x18, 0x30,
609 0x82, 0x01, 0xc2, 0x02, 0x09, 0x00, 0x8c, 0xc3, 0x37, 0x92, 0x10, 0xec, 0x2c,
610 0x98, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01,
611 0x05, 0x05, 0x00, 0x30, 0x81, 0x92, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
612 0x04, 0x06, 0x13, 0x02, 0x58, 0x58, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55,
613 0x04, 0x08, 0x13, 0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74,
614 0x65, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x04, 0x43,
615 0x69, 0x74, 0x79, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13,
616 0x18, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64,
617 0x67, 0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20, 0x4c, 0x74, 0x64, 0x31,
618 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x11, 0x66, 0x61, 0x6c,
619 0x73, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f,
620 0x6d, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
621 0x01, 0x09, 0x01, 0x16, 0x11, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x40, 0x65, 0x78,
622 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x1e, 0x17, 0x0d,
623 0x30, 0x39, 0x31, 0x30, 0x30, 0x38, 0x30, 0x30, 0x32, 0x35, 0x35, 0x33, 0x5a,
624 0x17, 0x0d, 0x31, 0x30, 0x31, 0x30, 0x30, 0x38, 0x30, 0x30, 0x32, 0x35, 0x35,
625 0x33, 0x5a, 0x30, 0x81, 0x92, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04,
626 0x06, 0x13, 0x02, 0x58, 0x58, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04,
627 0x08, 0x13, 0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74, 0x65,
628 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x04, 0x43, 0x69,
629 0x74, 0x79, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x18,
630 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64, 0x67,
631 0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20, 0x4c, 0x74, 0x64, 0x31, 0x1a,
632 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x11, 0x66, 0x61, 0x6c, 0x73,
633 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d,
634 0x31, 0x20, 0x30, 0x1e, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
635 0x09, 0x01, 0x16, 0x11, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x40, 0x65, 0x78, 0x61,
636 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x5c, 0x30, 0x0d, 0x06,
637 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03,
638 0x4b, 0x00, 0x30, 0x48, 0x02, 0x41, 0x00, 0xcd, 0xb7, 0x63, 0x9c, 0x32, 0x78,
639 0xf0, 0x06, 0xaa, 0x27, 0x7f, 0x6e, 0xaf, 0x42, 0x90, 0x2b, 0x59, 0x2d, 0x8c,
640 0xbc, 0xbe, 0x38, 0xa1, 0xc9, 0x2b, 0xa4, 0x69, 0x5a, 0x33, 0x1b, 0x1d, 0xea,
641 0xde, 0xad, 0xd8, 0xe9, 0xa5, 0xc2, 0x7e, 0x8c, 0x4c, 0x2f, 0xd0, 0xa8, 0x88,
642 0x96, 0x57, 0x72, 0x2a, 0x4f, 0x2a, 0xf7, 0x58, 0x9c, 0xf2, 0xc7, 0x70, 0x45,
643 0xdc, 0x8f, 0xde, 0xec, 0x35, 0x7d, 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0d,
644 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00,
645 0x03, 0x41, 0x00, 0xa6, 0x7b, 0x06, 0xec, 0x5e, 0xce, 0x92, 0x77, 0x2c, 0xa4,
646 0x13, 0xcb, 0xa3, 0xca, 0x12, 0x56, 0x8f, 0xdc, 0x6c, 0x7b, 0x45, 0x11, 0xcd,
647 0x40, 0xa7, 0xf6, 0x59, 0x98, 0x04, 0x02, 0xdf, 0x2b, 0x99, 0x8b, 0xb9, 0xa4,
648 0xa8, 0xcb, 0xeb, 0x34, 0xc0, 0xf0, 0xa7, 0x8c, 0xf8, 0xd9, 0x1e, 0xde, 0x14,
649 0xa5, 0xed, 0x76, 0xbf, 0x11, 0x6f, 0xe3, 0x60, 0xaa, 0xfa, 0x88, 0x21, 0x49,
650 0x04, 0x35,
653 var derEncodedPaypalNULCertBytes = []byte{
654 0x30, 0x82, 0x06, 0x44, 0x30,
655 0x82, 0x05, 0xad, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x03, 0x00, 0xf0, 0x9b,
656 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05,
657 0x05, 0x00, 0x30, 0x82, 0x01, 0x12, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
658 0x04, 0x06, 0x13, 0x02, 0x45, 0x53, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55,
659 0x04, 0x08, 0x13, 0x09, 0x42, 0x61, 0x72, 0x63, 0x65, 0x6c, 0x6f, 0x6e, 0x61,
660 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x09, 0x42, 0x61,
661 0x72, 0x63, 0x65, 0x6c, 0x6f, 0x6e, 0x61, 0x31, 0x29, 0x30, 0x27, 0x06, 0x03,
662 0x55, 0x04, 0x0a, 0x13, 0x20, 0x49, 0x50, 0x53, 0x20, 0x43, 0x65, 0x72, 0x74,
663 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74,
664 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x73, 0x2e, 0x6c, 0x2e, 0x31, 0x2e,
665 0x30, 0x2c, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x14, 0x25, 0x67, 0x65, 0x6e, 0x65,
666 0x72, 0x61, 0x6c, 0x40, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d,
667 0x20, 0x43, 0x2e, 0x49, 0x2e, 0x46, 0x2e, 0x20, 0x20, 0x42, 0x2d, 0x42, 0x36,
668 0x32, 0x32, 0x31, 0x30, 0x36, 0x39, 0x35, 0x31, 0x2e, 0x30, 0x2c, 0x06, 0x03,
669 0x55, 0x04, 0x0b, 0x13, 0x25, 0x69, 0x70, 0x73, 0x43, 0x41, 0x20, 0x43, 0x4c,
670 0x41, 0x53, 0x45, 0x41, 0x31, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
671 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72,
672 0x69, 0x74, 0x79, 0x31, 0x2e, 0x30, 0x2c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13,
673 0x25, 0x69, 0x70, 0x73, 0x43, 0x41, 0x20, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41,
674 0x31, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69,
675 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31,
676 0x20, 0x30, 0x1e, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09,
677 0x01, 0x16, 0x11, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x40, 0x69, 0x70,
678 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x39,
679 0x30, 0x32, 0x32, 0x34, 0x32, 0x33, 0x30, 0x34, 0x31, 0x37, 0x5a, 0x17, 0x0d,
680 0x31, 0x31, 0x30, 0x32, 0x32, 0x34, 0x32, 0x33, 0x30, 0x34, 0x31, 0x37, 0x5a,
681 0x30, 0x81, 0x94, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
682 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13,
683 0x0a, 0x43, 0x61, 0x6c, 0x69, 0x66, 0x6f, 0x72, 0x6e, 0x69, 0x61, 0x31, 0x16,
684 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x0d, 0x53, 0x61, 0x6e, 0x20,
685 0x46, 0x72, 0x61, 0x6e, 0x63, 0x69, 0x73, 0x63, 0x6f, 0x31, 0x11, 0x30, 0x0f,
686 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69,
687 0x74, 0x79, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x0b,
688 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x20, 0x55, 0x6e, 0x69, 0x74, 0x31, 0x2f,
689 0x30, 0x2d, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x26, 0x77, 0x77, 0x77, 0x2e,
690 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x00, 0x73, 0x73,
691 0x6c, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65,
692 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x63, 0x63, 0x30, 0x81, 0x9f, 0x30, 0x0d,
693 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00,
694 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xd2, 0x69,
695 0xfa, 0x6f, 0x3a, 0x00, 0xb4, 0x21, 0x1b, 0xc8, 0xb1, 0x02, 0xd7, 0x3f, 0x19,
696 0xb2, 0xc4, 0x6d, 0xb4, 0x54, 0xf8, 0x8b, 0x8a, 0xcc, 0xdb, 0x72, 0xc2, 0x9e,
697 0x3c, 0x60, 0xb9, 0xc6, 0x91, 0x3d, 0x82, 0xb7, 0x7d, 0x99, 0xff, 0xd1, 0x29,
698 0x84, 0xc1, 0x73, 0x53, 0x9c, 0x82, 0xdd, 0xfc, 0x24, 0x8c, 0x77, 0xd5, 0x41,
699 0xf3, 0xe8, 0x1e, 0x42, 0xa1, 0xad, 0x2d, 0x9e, 0xff, 0x5b, 0x10, 0x26, 0xce,
700 0x9d, 0x57, 0x17, 0x73, 0x16, 0x23, 0x38, 0xc8, 0xd6, 0xf1, 0xba, 0xa3, 0x96,
701 0x5b, 0x16, 0x67, 0x4a, 0x4f, 0x73, 0x97, 0x3a, 0x4d, 0x14, 0xa4, 0xf4, 0xe2,
702 0x3f, 0x8b, 0x05, 0x83, 0x42, 0xd1, 0xd0, 0xdc, 0x2f, 0x7a, 0xe5, 0xb6, 0x10,
703 0xb2, 0x11, 0xc0, 0xdc, 0x21, 0x2a, 0x90, 0xff, 0xae, 0x97, 0x71, 0x5a, 0x49,
704 0x81, 0xac, 0x40, 0xf3, 0x3b, 0xb8, 0x59, 0xb2, 0x4f, 0x02, 0x03, 0x01, 0x00,
705 0x01, 0xa3, 0x82, 0x03, 0x21, 0x30, 0x82, 0x03, 0x1d, 0x30, 0x09, 0x06, 0x03,
706 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x11, 0x06, 0x09, 0x60, 0x86,
707 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x01, 0x04, 0x04, 0x03, 0x02, 0x06, 0x40,
708 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x03, 0xf8,
709 0x30, 0x13, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x0c, 0x30, 0x0a, 0x06, 0x08,
710 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x1d, 0x06, 0x03, 0x55,
711 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x61, 0x8f, 0x61, 0x34, 0x43, 0x55, 0x14,
712 0x7f, 0x27, 0x09, 0xce, 0x4c, 0x8b, 0xea, 0x9b, 0x7b, 0x19, 0x25, 0xbc, 0x6e,
713 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14,
714 0x0e, 0x07, 0x60, 0xd4, 0x39, 0xc9, 0x1b, 0x5b, 0x5d, 0x90, 0x7b, 0x23, 0xc8,
715 0xd2, 0x34, 0x9d, 0x4a, 0x9a, 0x46, 0x39, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d,
716 0x11, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x1d, 0x12, 0x04,
717 0x15, 0x30, 0x13, 0x81, 0x11, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x40,
718 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x72, 0x06, 0x09,
719 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x0d, 0x04, 0x65, 0x16, 0x63,
720 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,
721 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4e,
722 0x4f, 0x54, 0x20, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, 0x44, 0x2e,
723 0x20, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x20, 0x53, 0x65, 0x72, 0x76,
724 0x65, 0x72, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
725 0x65, 0x20, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x68,
726 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70,
727 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x30, 0x2f, 0x06, 0x09, 0x60,
728 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x02, 0x04, 0x22, 0x16, 0x20, 0x68,
729 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70,
730 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61,
731 0x32, 0x30, 0x30, 0x32, 0x2f, 0x30, 0x43, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
732 0x86, 0xf8, 0x42, 0x01, 0x04, 0x04, 0x36, 0x16, 0x34, 0x68, 0x74, 0x74, 0x70,
733 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61,
734 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30,
735 0x32, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x43, 0x4c,
736 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x46, 0x06, 0x09,
737 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x03, 0x04, 0x39, 0x16, 0x37,
738 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69,
739 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63,
740 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x72, 0x65, 0x76, 0x6f, 0x63, 0x61, 0x74,
741 0x69, 0x6f, 0x6e, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x68, 0x74,
742 0x6d, 0x6c, 0x3f, 0x30, 0x43, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8,
743 0x42, 0x01, 0x07, 0x04, 0x36, 0x16, 0x34, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a,
744 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63,
745 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f,
746 0x72, 0x65, 0x6e, 0x65, 0x77, 0x61, 0x6c, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41,
747 0x31, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x3f, 0x30, 0x41, 0x06, 0x09, 0x60, 0x86,
748 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x08, 0x04, 0x34, 0x16, 0x32, 0x68, 0x74,
749 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73,
750 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32,
751 0x30, 0x30, 0x32, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x4c, 0x41,
752 0x53, 0x45, 0x41, 0x31, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x30, 0x81, 0x83, 0x06,
753 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x7c, 0x30, 0x7a, 0x30, 0x39, 0xa0, 0x37, 0xa0,
754 0x35, 0x86, 0x33, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77,
755 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70,
756 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61,
757 0x32, 0x30, 0x30, 0x32, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x63,
758 0x72, 0x6c, 0x30, 0x3d, 0xa0, 0x3b, 0xa0, 0x39, 0x86, 0x37, 0x68, 0x74, 0x74,
759 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x2e, 0x69,
760 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63,
761 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30,
762 0x30, 0x32, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x63, 0x72, 0x6c,
763 0x30, 0x32, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04,
764 0x26, 0x30, 0x24, 0x30, 0x22, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07,
765 0x30, 0x01, 0x86, 0x16, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6f, 0x63,
766 0x73, 0x70, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
767 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05,
768 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x68, 0xee, 0x79, 0x97, 0x97, 0xdd, 0x3b,
769 0xef, 0x16, 0x6a, 0x06, 0xf2, 0x14, 0x9a, 0x6e, 0xcd, 0x9e, 0x12, 0xf7, 0xaa,
770 0x83, 0x10, 0xbd, 0xd1, 0x7c, 0x98, 0xfa, 0xc7, 0xae, 0xd4, 0x0e, 0x2c, 0x9e,
771 0x38, 0x05, 0x9d, 0x52, 0x60, 0xa9, 0x99, 0x0a, 0x81, 0xb4, 0x98, 0x90, 0x1d,
772 0xae, 0xbb, 0x4a, 0xd7, 0xb9, 0xdc, 0x88, 0x9e, 0x37, 0x78, 0x41, 0x5b, 0xf7,
773 0x82, 0xa5, 0xf2, 0xba, 0x41, 0x25, 0x5a, 0x90, 0x1a, 0x1e, 0x45, 0x38, 0xa1,
774 0x52, 0x58, 0x75, 0x94, 0x26, 0x44, 0xfb, 0x20, 0x07, 0xba, 0x44, 0xcc, 0xe5,
775 0x4a, 0x2d, 0x72, 0x3f, 0x98, 0x47, 0xf6, 0x26, 0xdc, 0x05, 0x46, 0x05, 0x07,
776 0x63, 0x21, 0xab, 0x46, 0x9b, 0x9c, 0x78, 0xd5, 0x54, 0x5b, 0x3d, 0x0c, 0x1e,
777 0xc8, 0x64, 0x8c, 0xb5, 0x50, 0x23, 0x82, 0x6f, 0xdb, 0xb8, 0x22, 0x1c, 0x43,
778 0x96, 0x07, 0xa8, 0xbb,
781 var stringSliceTestData = [][]string{
782 {"foo", "bar"},
783 {"foo", "\\bar"},
784 {"foo", "\"bar\""},
785 {"foo", "åäö"},
788 func TestStringSlice(t *testing.T) {
789 for _, test := range stringSliceTestData {
790 bs, err := Marshal(test)
791 if err != nil {
792 t.Error(err)
795 var res []string
796 _, err = Unmarshal(bs, &res)
797 if err != nil {
798 t.Error(err)
801 if fmt.Sprintf("%v", res) != fmt.Sprintf("%v", test) {
802 t.Errorf("incorrect marshal/unmarshal; %v != %v", res, test)