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 {