X509 certificate import not working

Hi, I’m trying to import a X509 certificate because I need to run a MQTT client over SSL. I’m using M2MQTT and works fine, but when I try to using it over SSL with X509 certificate I can`t find the way.

I tried to import the certificate with the Certificates application in Control Panel and then I run the example code below (C#) to test if I can get some certificate but the result in all stores is 0.

private static void DumpCertCounts()
		{
			var userStore = new X509Store(StoreName.Root, StoreLocation.CurrentUser);

			var deviceStore = new X509Store(StoreName.Root, StoreLocation.LocalMachine);

			Console.WriteLine(string.Format("Root:	{0}		 {1}",userStore.Certificates.Count,deviceStore.Certificates.Count));

			userStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
			
			deviceStore = new X509Store(StoreName.My, StoreLocation.LocalMachine);

			Console.WriteLine(string.Format("My:    {0}      {1}",userStore.Certificates.Count,deviceStore.Certificates.Count));

			userStore = new X509Store(StoreName.CertificateAuthority, StoreLocation.CurrentUser);

			deviceStore = new X509Store(StoreName.CertificateAuthority, StoreLocation.LocalMachine);

			Console.WriteLine(string.Format("CA:    {0}      {1}",userStore.Certificates.Count,deviceStore.Certificates.Count));
		}

Dou you have any example on how to do this? Or if there is a way of doing it in C I could pInvoke from C#.

Thanks in advanced.

Dear @skbo,

I am working on this. Meanwhile, Could you please find here for more information? If you need to verify about catalog components please refer “\Windows\ceconfig.h” for included components.

Please let us know if you find a solution and any other help for this. Let you know if I find something.

Reference links:
https://www.toradex.com/community/questions/10998/can-i-implement-secure-ftp-on-windows-ce7-or-ec201.html

https://www.toradex.com/community/search.html?f=&type=question&redirect=search%2Fsearch&sort=relevance&q=SSL+Certificate+%5Bwince%5D