Revision: 4165
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at October 29, 2007 16:57 by rengber
Initial Code
public static X509Certificate2 GetCert(string thumbprint,
StoreName storeName,
StoreLocation storeLocation)
{
// The following code gets the cert from the keystore
X509Store store = new X509Store(storeName, storeLocation);
store.Open(OpenFlags.ReadOnly);
X509Certificate2Collection certCollection =
store.Certificates.Find(X509FindType.FindByThumbprint,
thumbprint,
false);
X509Certificate2Enumerator enumerator = certCollection.GetEnumerator();
X509Certificate2 cert = null;
while (enumerator.MoveNext())
{
cert = enumerator.Current;
}
return cert;
}
Initial URL
http://support.microsoft.com/default.aspx?scid=kb;en-us;901183
Initial Description
Generate the Cert: makecert -sy 3 -n "cn=FooCorp" -ss my -sr LocalMachine Grant Permissions to the Cert: winHttpCertCfg -g -c LOCAL_MACHINE\MY -s "FooCorp" -a "domain\YourMomma"
Initial Title
Getting X509 Certificates in and out of the Key Store
Initial Tags
Initial Language
C#