mirror of
https://github.com/square/certigo.git
synced 2024-04-21 12:32:40 +00:00
Merge pull request #42 from square/cdenny/fixConflict
Cdenny/fix conflict
This commit is contained in:
Binary file not shown.
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user