How to store private data in blockchain and smart contract Following my previous question on this topic Is there a way to store and share a private key through blockchain?, I might have a solution but I would like to improve the process.

Image that A is the owner of some private data, and want to give the ownership of this data to B, another member of the blockchain. The data is a private key so it can not be public, but it can be encoded using A or B public key.

So:


Secret data is encoded with A public key, and stored in A informations data /
B want to by A secret data
A decode the secret data (using his private wallet key) and encode the secret data with B public key
Ownership of the data is given to B
Now only B (and A also but that's a different story) can decode secret data.


Is there a way to simplify this process using smart contract? I assume a smart contract have access to A and B public key, but can a data be encoded/decoded with private key of the one executing the smart contract?
If I've understood correctly, I don't think you need block-chain technology to achieve what you want. This is exactly what asymmetric public key encryption is designed for. 

A simply encrypts some information using A's private key and B's public key... thereby ensuring:


Only B can decrypt the information 
B can verify the information was
encrypted by A (using A's public key)


There's no way for A to prove to B that their copy of the information has been destroyed or forgotten by A, but at least secure transmission is ensured.