Best solution to encrypt a token using my public key

Hi, I have a certificate installed and I want to use the public key from my certificate to encrypt a token that I receive from another system. What is the best way to do this? My problem is to get the public key from the certificate
1 answers

It is not possible to 'just request' a certificate from the local computer.
Otherwise any website would be able to pull your certificate and use it as if that system were you.

Your requested solution, pulling the whole certificate from a computer onto the server is a huge security issue and if your application would somehow be able to pull that certificate most virus software tools would classify your solution as malware.

I can understand the need, but this can only be achieved by using the concept 'Delegated Authentication', the system you are calling needs to be aware of your system and you need to be able to use your end-user credentials to authenticate on behave of him.