mirror of
https://github.com/square/certigo.git
synced 2026-10-21 06:45:42 +00:00
Added der support and a sample der cert in the certs folder.
This commit is contained in:
Binary file not shown.
@@ -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: ")
|
||||
|
||||
Reference in New Issue
Block a user