working on key certificates and keys and cert

This commit is contained in:
Hayden Parker
2016-02-13 21:00:29 -08:00
parent 7e9aee0714
commit f409aa79e8
12 changed files with 287 additions and 105 deletions

View File

@ -5,9 +5,13 @@ import "testing"
func TestCertificateTypeIsFirstByte(t *testing.T) {
bytes := []byte{0x03, 0x00, 0x00}
certificate := Certificate(bytes)
if certificate.Type() != 0x03 {
cert_type, err := certificate.Type()
if cert_type != 3 {
t.Fatal("certificate.Type() is not first byte")
}
if err != nil {
t.Fatal("certificate.Type returned error on valid data:", err)
}
}
func TestCertificateLengthCorrect(t *testing.T) {