func privKeyToPEM(key interface{}) (string, error) {
	privBytes, err := x509.MarshalPKCS8PrivateKey(key)
	if err != nil {
		return "", err
	}

	var b bytes.Buffer
	err = pem.Encode(&b, &pem.Block{Type: "PRIVATE KEY", Bytes: privBytes})
	return b.String(), err
}
// PrivKeyToPEM Convert a private key into PKCS8/PEM format
PrivKeyToPEM Convert a private key into PKCS8/PEM format
// PrivKeyToPEM Convert a private key into PKCS8 / PEM format
func privKeyToPEM(key interface{}) (string, error) {
	privBytes, err := x509.MarshalPKCS8PrivateKey(key)
	if err != nil {
		return "", err
	}
	var b bytes.Buffer
	err = pem.Encode(&b, &pem.Block{Type: "PRIVATE KEY", Bytes: privBytes})
	return b.String(), err
}
func privKeyToPEM ( key interface { } ) ( string , error ) { privBytes , err := x509 . MarshalPKCS8PrivateKey ( key ) if err != nil { return " " , err } var b bytes . Buffer err = pem . Encode ( & b , & pem . Block { Type : " " , Bytes : privBytes } ) return b . String ( ) , err }
PrivKeyToPEM Convert a private key into PKCS8/PEM format
PrivKeyToPEM Convert a private key into PKCS8 / PEM format