From 99dd0953c4001971b7020516c3fa0787696da29a Mon Sep 17 00:00:00 2001 From: William Date: Wed, 8 Apr 2020 21:46:31 -0700 Subject: [PATCH] Add support for RSA private key to TLS utils. Co-authored-by: Thomas Detoux --- tlsutil/generate.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tlsutil/generate.go b/tlsutil/generate.go index 215738689..7aed988cb 100644 --- a/tlsutil/generate.go +++ b/tlsutil/generate.go @@ -173,6 +173,10 @@ func ParseSigner(pemValue string) (crypto.Signer, error) { switch block.Type { case "EC PRIVATE KEY": return x509.ParseECPrivateKey(block.Bytes) + + case "RSA PRIVATE KEY": + return x509.ParsePKCS1PrivateKey(block.Bytes) + default: return nil, fmt.Errorf("unknown PEM block type for signing key: %s", block.Type) }