title: Initialisting KeyInfo with X509 certificate parameters
body: <p>This is a question for C# language.</p>
  
  <p>I am having a reference to X509 Certificate in one class A(<strong>call it sslCert</strong>) i.e i can access the various members associated with the X509 certificate.</p>
  
  <p>Also, i am having a Class B having following 2 crypto key members -->
  <strong>KeyInfo publicKey;
  KeyInfo privateKey;</strong></p>
  
  <p>The problem is that i am not able to find the way to set these 2 values (publickey &amp; privatekey) with the Public Key and Private Key values from the X509. Direct assignment doesnt work and complains about data type mismatches.</p>
  
  <pre><code>B.publicKey = A.sslcertificate.Certificate.PublicKey;
  B.privateKey = A.sslcertificate.Certificate.PrivateKey;
  </code></pre>
  
  <p>I have tried alot but not knowing what is the exact assignment way to achieve that. Anyone can throw some light on this?</p>
  
  <p>Thanks !!!</p>