Skip to content

Commit

Permalink
Merge pull request #772 from TheRealHaoLiu/work-with-new-openssl
Browse files Browse the repository at this point in the history
Handle PKCS8PrivateKey
  • Loading branch information
TheRealHaoLiu authored Apr 19, 2023
2 parents d4f548c + 51099fb commit 50db04b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/certificates/ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ func LoadFromPEMFile(filename string) ([]interface{}, error) {
return nil, err
}
results = append(results, key)
case "PRIVATE KEY":
key, err := x509.ParsePKCS8PrivateKey(block.Bytes)
if err != nil {
return nil, err
}
results = append(results, key)
case "PUBLIC KEY":
key, err := x509.ParsePKIXPublicKey(block.Bytes)
if err != nil {
Expand Down

0 comments on commit 50db04b

Please sign in to comment.