title: How to obtain CN of the certificates in particular store?
body: <p>i want to obtain the <strong>CN</strong> of the certificates stored in the <strong>MY store</strong> as i want to <strong>verify</strong> if the <strong>certificate</strong> exists or not in that store.</p>
  
  <p>I don't know the which method should be used to perform this task.</p>
  
  <p>I tried using below code but it doesn't works</p>
  
  <pre><code>X509Certificate2Collection cers =  store.Certificates.Find(X509FindType.FindBySubjectName,"Root_Certificate",false);
  
  if(cers.Count&gt;0)
  {
  
  //certificate present
  
  }
  
  else
  {
  
  //certificate not present
  
  }
  </code></pre>
  
  <p>Does the <strong>subjectName gives CN</strong>?</p>
  
  <p>is there any other method?</p>
  
  <p>Please suggest me how to check whether a particular certificate is present or not and i want to do it using CN.</p>