title: Using public key in asymmetric encryption with X.509 certificates
body: <p>Sometimes ago I've read an article about using asymmetric keys like public and private keys to send data securely. What I've understood was that the <strong>server</strong> has 1 key <strong>(private key)</strong> that it use to encrypt data and all <strong>clients</strong> use the second key <strong>(public key)</strong> to decrypt it.</p>
  
  <p>Now how should I expect to receive the key and how should I work with?</p>
  
  <p>If I receive a Certificate from the server, wouldn't it contain both public and private keys?!</p>
  
  <pre><code>X509Store certStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
  var cert = GetCertificate(certStore);
  var privatekey= cert.PrivateKey;
  var publicKey= cert.PublicKey;
  </code></pre>
  
  <p>Is it possbile to remove the private key from the certificate? How? and how can I understand if the certificate has the private key?</p>