T
Tom
I am developing on a custom CE 5.0 board, and I am trying to open the
system certificate store using CertOpenSystemStore() from the
Crypt32.dll library. The problem is that I am getting a "Can't find
an Entry Point 'CertOpenSystemStore' in a PInvoke DLL 'crypt32.dll'."
The strange thing is that I am using other cert functions from
Crypt32.dll such as PFXImportCertStore() and PFXIsPFXBlob(). I know
that I needed to add the PKCS #12 component to the platform in order
to use the PFX functionality. Do I need to add something else to get
the rest of the functionality of Crypt32.dll?
Here are some snippets of the code:
[DllImport("crypt32.dll", SetLastError = true)]
public static extern IntPtr CertOpenSystemStore(
IntPtr hCryptProv,
[MarshalAs(UnmanagedType.LPWStr)] String szPassword);
//Open the JCID stores MY , CA and Root
IntPtr hMyStore = IntPtr.Zero;
IntPtr hCAStore = IntPtr.Zero;
IntPtr hRootStore = IntPtr.Zero;
try
{
hMyStore = CertOpenSystemStore(IntPtr.Zero, "MY");
hCAStore = CertOpenSystemStore(IntPtr.Zero, "CA");
hRootStore = CertOpenSystemStore(IntPtr.Zero,
"ROOT");
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine(e.ToString());
}
It will catch here...
Anyone know the answer?
Thanks,
Tom
system certificate store using CertOpenSystemStore() from the
Crypt32.dll library. The problem is that I am getting a "Can't find
an Entry Point 'CertOpenSystemStore' in a PInvoke DLL 'crypt32.dll'."
The strange thing is that I am using other cert functions from
Crypt32.dll such as PFXImportCertStore() and PFXIsPFXBlob(). I know
that I needed to add the PKCS #12 component to the platform in order
to use the PFX functionality. Do I need to add something else to get
the rest of the functionality of Crypt32.dll?
Here are some snippets of the code:
[DllImport("crypt32.dll", SetLastError = true)]
public static extern IntPtr CertOpenSystemStore(
IntPtr hCryptProv,
[MarshalAs(UnmanagedType.LPWStr)] String szPassword);
//Open the JCID stores MY , CA and Root
IntPtr hMyStore = IntPtr.Zero;
IntPtr hCAStore = IntPtr.Zero;
IntPtr hRootStore = IntPtr.Zero;
try
{
hMyStore = CertOpenSystemStore(IntPtr.Zero, "MY");
hCAStore = CertOpenSystemStore(IntPtr.Zero, "CA");
hRootStore = CertOpenSystemStore(IntPtr.Zero,
"ROOT");
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine(e.ToString());
}
It will catch here...
Anyone know the answer?
Thanks,
Tom