func publicRSAKeyToBytes(pub *rsa.PublicKey) []byte {
	pubASN1, err := x509.MarshalPKIXPublicKey(pub)
	if err != nil {
		log.Fatal(err)
	}

	pubBytes := pem.EncodeToMemory(&pem.Block{
		Type:  "RSA PUBLIC KEY",
		Bytes: pubASN1,
	})

	return pubBytes
}
// rsaPublicKeyToBytes transforms the public key to PKIX, ASN.1 DER form bytes
rsaPublicKeyToBytes transforms the public key to PKIX, ASN.1 DER form bytes
// rsaPublicKeyToBytes transforms the public key to PKIX ASN . 1 DER form bytes
func publicRSAKeyToBytes(pub *rsa.PublicKey) []byte {
	pubASN1, err := x509.MarshalPKIXPublicKey(pub)
	if err != nil {
		log.Fatal(err)
	}
	pubBytes := pem.EncodeToMemory(&pem.Block{
		Type:  "RSA PUBLIC KEY",
		Bytes: pubASN1,
	})
	return pubBytes
}
func publicRSAKeyToBytes ( pub * rsa . PublicKey ) [ ] byte { pubASN1 , err := x509 . MarshalPKIXPublicKey ( pub ) if err != nil { log . Fatal ( err ) } pubBytes := pem . EncodeToMemory ( & pem . Block { Type : " " , Bytes : pubASN1 , } ) return pubBytes }
rsaPublicKeyToBytes transforms the public key to PKIX, ASN.1 DER form bytes
rsaPublicKeyToBytes transforms the public key to PKIX ASN . 1 DER form bytes