Golang, it is safe storing pem encrypted block? : Well, hi, i have some experience using Go, but now i don't really understand the complexity in security of what i am doing, so i need to ask.

I am creating a rsa private key, converting to pem and then encryping it with a passphrase.

So, how secure is to store it in a public place?

I'm not looking for asnwers like "it's ok, just change the passphrase over time", i really want to know wich mechanism of cypher Golang is using to do it and if is safe to leave the encrypted pem in, for example, a public blockchain and why i can do it or why i cannot.

I'm leaving here the code i am using right now:

<pre>

    func New(passphrase string)(*pem.Block, error){
    	pk, err := createPrivateKey(2048)
    	if err != nil {
    		return false, err
    	}
    	pem := getPemFromPK(pk)
    	block, err := EncryptPEMBlock(pem,passphrase)
    	if err != nil {
    		return false, err
    	}
    	
    	return block,nil
    }
    
    func createPrivateKey(bits int) (*rsa.PrivateKey, error){
        pk, err := rsa.GenerateKey(rand.Reader, bits)
        if err != nil {
            return nil, err
    	}
    	return pk,nil
    }
    
    func getPemFromPK(pk *rsa.PrivateKey) (*pem.Block){
        block := &pem.Block{
            Type:  "RSA PRIVATE KEY",
            Bytes: x509.MarshalPKCS1PrivateKey(pk),
    	}
    	return block
    }
    
    func EncryptPEMBlock(block *pem.Block, passphrase string) (*pem.Block, error){
    	block, err := x509.EncryptPEMBlock(rand.Reader, block.Type, block.Bytes, []byte(passphrase), x509.PEMCipherAES256)
    	if err != nil {
    		return nil, err
    	}
    	return block,nil
    }

</pre>

Thank you very much.