diff options
author | Ruben Pollan <meskio@sindominio.net> | 2018-06-08 10:26:58 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2018-06-20 12:18:03 +0200 |
commit | fcc7514ec5f1b35068b1033d8ac4278c45043a80 (patch) | |
tree | 0ad4d5f4d650ab2a01879e4f31faedf848c39287 /bitmask_go/bonafide_test.go | |
parent | 11094e0f58e1f28f5333a91f3c4129b56ad154e6 (diff) |
[feat] pure go bitmask vpn implemenation
- Resolves: #42
Diffstat (limited to 'bitmask_go/bonafide_test.go')
-rw-r--r-- | bitmask_go/bonafide_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/bitmask_go/bonafide_test.go b/bitmask_go/bonafide_test.go new file mode 100644 index 0000000..c40c98d --- /dev/null +++ b/bitmask_go/bonafide_test.go @@ -0,0 +1,26 @@ +package bitmask + +import ( + "bytes" + "testing" +) + +var ( + privateKeyHeader = []byte("-----BEGIN RSA PRIVATE KEY-----") + certHeader = []byte("-----BEGIN CERTIFICATE-----") +) + +func TestGetCert(t *testing.T) { + cert, err := getCertPem() + if err != nil { + t.Fatal("get_cert returned an error: ", err) + } + + if !bytes.Contains(cert, privateKeyHeader) { + t.Errorf("No private key present: \n%q", cert) + } + + if !bytes.Equal(cert, certHeader) { + t.Errorf("No cert present: \n%q", cert) + } +} |