Skip to content

Commit

Permalink
Merge pull request #58 from square/cs/various
Browse files Browse the repository at this point in the history
Couple of fixes
  • Loading branch information
csstaub authored Jun 13, 2016
2 parents 3727194 + d449f16 commit 04cc4ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ var fileExtToFormat = map[string]string{
".p12": "PKCS12",
".pfx": "PKCS12",
".jceks": "JCEKS",
".jks": "JCEKS", // Only partially supported
".der": "DER",
}

Expand Down Expand Up @@ -211,6 +212,9 @@ func getCerts(reader io.Reader, filename string, format string) ([]certWithAlias
if err != nil {
return nil, err
}
if len(blocks) == 0 {
return nil, fmt.Errorf("keystore appears to be empty or password was incorrect")
}
for _, block := range blocks {
if block.Type == "CERTIFICATE" {
cert, err := x509.ParseCertificate(block.Bytes)
Expand Down

0 comments on commit 04cc4ae

Please sign in to comment.