Update go dependencies

This commit is contained in:
Manuel de Brito Fontes 2018-05-26 11:27:53 -04:00 committed by Manuel Alejandro de Brito Fontes
parent 15ffb51394
commit bb4d483837
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
1621 changed files with 86368 additions and 284392 deletions

View file

@ -1,33 +0,0 @@
package certUtil
import (
"crypto/x509"
"testing"
"os"
"io/ioutil"
"github.com/stretchr/testify/assert"
)
func TestFetchCertificateChain(t *testing.T) {
file, err := os.Open("../tests/comodo.der.crt")
if err != nil {
t.Error(err)
}
data, err := ioutil.ReadAll(file)
if err != nil {
t.Error(err)
}
cert, err := x509.ParseCertificate(data)
if err != nil {
t.Error(err)
}
certs, err := FetchCertificateChain(cert)
if err != nil {
t.Error(err)
}
assert.Equal(t, 3, len(certs))
}

View file

@ -1,11 +0,0 @@
package certUtil
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestIsPEM(t *testing.T) {
assert.True(t, IsPEM([]byte("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----")))
assert.False(t, IsPEM([]byte("xxx")))
}