From 8f4a716de09abf42f25b8093d2ebe444f7a4f531 Mon Sep 17 00:00:00 2001 From: Christian Banse Date: Sat, 31 Jul 2021 14:36:53 +0200 Subject: [PATCH] Deprecating `ParseRSAPrivateKeyFromPEMWithPassword` since the underyling `x509.DecryptPEMBlock` is deprecated in Go 1.16, since RFC 1423 is considered to be insecure by design. --- rsa_utils.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rsa_utils.go b/rsa_utils.go index 14c78c2..8865c00 100644 --- a/rsa_utils.go +++ b/rsa_utils.go @@ -40,6 +40,10 @@ func ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error) { } // Parse PEM encoded PKCS1 or PKCS8 private key protected with password + +// Deprecated: This function is deprecated and should not be used anymore. It uses the deprecated x509.DecryptPEMBlock +// function, which was deprecated since RFC 1423 is regarded insecure by design. Unfortunately, there is no alternative +// in the Go standard library for now. See https://github.com/golang/go/issues/8860. func ParseRSAPrivateKeyFromPEMWithPassword(key []byte, password string) (*rsa.PrivateKey, error) { var err error