diff options
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) + } +} |