Merge pull request #42 from square/cdenny/fixConflict

Cdenny/fix conflict
This commit is contained in:
Christopher Denny
2016-06-07 15:02:55 -07:00
3 changed files with 11 additions and 0 deletions
BIN
View File
Binary file not shown.
View File
+11
View File
@@ -46,6 +46,7 @@ var fileExtToFormat = map[string]string{
".p12": "PKCS12",
".pfx": "PKCS12",
".jceks": "JCEKS",
".der": "DER",
}
type certWithAlias struct {
@@ -120,6 +121,16 @@ func getCerts(reader io.Reader, format string) ([]certWithAlias, error) {
certs = append(certs, certWithAlias{cert: cert})
block, data = pem.Decode(data)
}
case "DER":
data, err := ioutil.ReadAll(reader)
if err != nil {
return nil, err
}
cert, err := x509.ParseCertificate(data)
if err != nil {
return nil, err
}
certs = append(certs, certWithAlias{cert: cert})
case "PKCS12":
data, err := ioutil.ReadAll(reader)
if err != nil {