Skip to content

Commit 4ac38eb

Browse files
committed
cmd/dkim-milter: add support for PKCS #8 keys
1 parent 407ce64 commit 4ac38eb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/dkim-milter/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,12 @@ func loadPrivateKey(path string) (crypto.Signer, error) {
345345
}
346346

347347
switch strings.ToUpper(block.Type) {
348+
case "PRIVATE KEY":
349+
k, err := x509.ParsePKCS8PrivateKey(block.Bytes)
350+
if err != nil {
351+
return nil, err
352+
}
353+
return k.(crypto.Signer), nil
348354
case "RSA PRIVATE KEY":
349355
return x509.ParsePKCS1PrivateKey(block.Bytes)
350356
case "EDDSA PRIVATE KEY":

0 commit comments

Comments
 (0)