From 5b806c85fed42091144a00c14a5791f210aa44a2 Mon Sep 17 00:00:00 2001 From: Sun Yimin Date: Wed, 1 Feb 2023 17:34:42 +0800 Subject: [PATCH] pkcs8: fix comments --- pkcs8/example_test.go | 4 ++-- pkcs8/pkcs8.go | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pkcs8/example_test.go b/pkcs8/example_test.go index 13ce2d3..479cc71 100644 --- a/pkcs8/example_test.go +++ b/pkcs8/example_test.go @@ -27,7 +27,7 @@ func ExampleMarshalPrivateKey_withoutPassword() { return } - // ecode to pem + // encode der bytes to pem block := &pem.Block{Bytes: der, Type: "PRIVATE KEY"} pemContent := string(pem.EncodeToMemory(block)) fmt.Printf("%v\n", pemContent) @@ -131,7 +131,7 @@ func ExampleMarshalPrivateKey() { return } - // ecode to pem + // encode der bytes to pem block := &pem.Block{Bytes: der, Type: "ENCRYPTED PRIVATE KEY"} pemContent := string(pem.EncodeToMemory(block)) fmt.Printf("%v\n", pemContent) diff --git a/pkcs8/pkcs8.go b/pkcs8/pkcs8.go index 1ca1f50..175a4f2 100644 --- a/pkcs8/pkcs8.go +++ b/pkcs8/pkcs8.go @@ -400,8 +400,6 @@ func ParseSM9EncryptPrivateKey(der []byte, v ...[]byte) (*sm9.EncryptPrivateKey, // ConvertPrivateKeyToPKCS8 converts the private key into PKCS#8 format. // To encrypt the private key, the password of []byte type should be provided as the second parameter. -// -// The only supported key types are RSA and ECDSA (*rsa.PrivateKey or *ecdsa.PrivateKey for priv) func ConvertPrivateKeyToPKCS8(priv interface{}, v ...[]byte) ([]byte, error) { var password []byte if len(v) > 0 {