Fix panic

This commit is contained in:
Matt Holt 2015-10-17 20:58:14 -06:00
parent 7f6f790253
commit 5d31b0a04c

View file

@ -33,7 +33,7 @@ func pemEncode(data interface{}) []byte {
pemBlock = &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(key)} pemBlock = &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(key)}
break break
case derCertificateBytes: case derCertificateBytes:
pemBlock = &pem.Block{Type: "CERTIFICATE", Bytes: data.([]byte)} pemBlock = &pem.Block{Type: "CERTIFICATE", Bytes: []byte(data.(derCertificateBytes))}
} }
return pem.EncodeToMemory(pemBlock) return pem.EncodeToMemory(pemBlock)