-
Notifications
You must be signed in to change notification settings - Fork 2
/
herots_test.go
67 lines (62 loc) · 3.28 KB
/
herots_test.go
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
package herots
import (
"testing"
)
//TODO: more tests :)
func TestLoadKeyPair(t *testing.T) {
h := NewServer()
err := h.LoadKeyPair([]byte(c0), []byte(k0))
if err != nil {
t.Fatalf("can't load normal public/private key pair:\n%v\n", err)
}
}
const c0 = `-----BEGIN CERTIFICATE-----
MIID3DCCAsagAwIBAgICBnUwCwYJKoZIhvcNAQELMGIxETAPBgNVBAYTCFNoYW1i
YWxhMQwwCgYDVQQKEwNaRU4xDTALBgNVBAsTBE9tIDAxCzAJBgNVBAcTAlVBMQ8w
DQYDVQQIEwZzaGFtIDAxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xNDEyMjkxNDU0
MTBaFw0yNDEyMjkxNDU0MTBaMGIxETAPBgNVBAYTCFNoYW1iYWxhMQwwCgYDVQQK
EwNaRU4xDTALBgNVBAsTBE9tIDAxCzAJBgNVBAcTAlVBMQ8wDQYDVQQIEwZzaGFt
IDAxEjAQBgNVBAMTCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
AQoCggEBAK3MZTm4lfof0th7T1WN1jN+WEfIPviCy73NB1iWZ5c9ut2Jqiy6ZX/g
XCMR7V/EMYKK6I4HD2MT1AowbK0W+dahEhftcyQx/pVJInF70wPtxuEjI6c38POW
zz73iMAombAh09+M2bcCgL9l6nQZf+V14xeKI4caWEsTb2RSr8pwPloJMQ2dwLeZ
bV4sCCtvK7WYGOWxbnaIq9F/f9Qsycue7z2413E3wcF93i2/uGeYd8/Iu0j5Y5mL
OjSWOqNJTzHsGraPZAXqdERF8gddKNx/I+E9ZWorvT96nkEonEjP5aFajBn1gW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