func SignerToPemWriter(writer io.Writer, signer crypto.Signer) error {
	der, err := x509.MarshalPKCS8PrivateKey(signer)
	if err != nil {
		return errors.Annotate(err, "marshalling signer to pkcs8 format")
	}

	err = pem.Encode(writer, &pem.Block{
		Type:  PEMTypePKCS8,
		Bytes: der,
	})
	if err != nil {
		return errors.Annotate(err, "encoding signer to pkcs8 pem format")
	}
	return nil
}
// SignerToPemWriter transforms a crypto signer to PKCS8 pem using the supplied
// writer
SignerToPemWriter transforms a crypto signer to PKCS8 pem using the supplied
writer
// SignerToPemWriter transforms a crypto signer to PKCS8 pem using the supplied // writer
func SignerToPemWriter(writer io.Writer, signer crypto.Signer) error {
	der, err := x509.MarshalPKCS8PrivateKey(signer)
	if err != nil {
		return errors.Annotate(err, "marshalling signer to pkcs8 format")
	}
	err = pem.Encode(writer, &pem.Block{
		Type:  PEMTypePKCS8,
		Bytes: der,
	})
	if err != nil {
		return errors.Annotate(err, "encoding signer to pkcs8 pem format")
	}
	return nil
}
func SignerToPemWriter ( writer io . Writer , signer crypto . Signer ) error { der , err := x509 . MarshalPKCS8PrivateKey ( signer ) if err != nil { return errors . Annotate ( err , " " ) } err = pem . Encode ( writer , & pem . Block { Type : PEMTypePKCS8 , Bytes : der , } ) if err != nil { return errors . Annotate ( err , " " ) } return nil }
SignerToPemWriter transforms a crypto signer to PKCS8 pem using the supplied
writer
SignerToPemWriter transforms a crypto signer to PKCS8 pem using the supplied writer