Skip to content

Commit

Permalink
Handle PKCS8PrivateKey
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealHaoLiu committed Apr 18, 2023
1 parent d4f548c commit 51099fb
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 51099fb

Please sign in to comment.