diff --git a/certs/cert.der b/certs/cert.der new file mode 100644 index 0000000..389e938 Binary files /dev/null and b/certs/cert.der differ diff --git a/main.go b/main.go index 1019c76..25884a8 100644 --- a/main.go +++ b/main.go @@ -45,6 +45,8 @@ var fileExtToFormat = map[string]string{ ".p12": "PKCS12", ".pfx": "PKCS12", ".jceks": "JCEKS", + ".jks": "JCEKS", + ".der": "DER", } type certWithAlias struct { @@ -105,6 +107,12 @@ func getCerts(file, format string) ([]certWithAlias, error) { certs = append(certs, certWithAlias{cert: cert}) block, data = pem.Decode(data) } + case "DER": + cert, err := x509.ParseCertificate(data) + if err != nil { + return nil, err + } + certs = append(certs, certWithAlias{cert: cert}) case "PKCS12": scanner := bufio.NewReader(os.Stdin) fmt.Print("Enter password: ")