I want to create certificate with public and private key. Then I want to extract public key from it and with the help of public key I want to encrypt data.
On the receiver side I want to decrypt data.
How can i create required certificate? Sample code for encryption and decryption.