How to create rootCA for UWP applications in Windows 10?

I am trying to create a root certificate authority for a UWP application that allows users to install a certificate before the application is powered on. X509 certificates cannot be used here. I am trying to use the standard "Certificate" class inside Windows.Security.Cryptography.Certificates namespace.Now after creating the certificate I cannot add the certificate to the certificate store. Can someone help me with this?

this is my code

byte[] buffer = File.ReadAllBytes(path: @"C:\Users\Administrator\documents\visual studio 2015\Projects\rootCA\rootCA\dig.crt");
String Cert = Convert.ToBase64String(buffer);
byte[] _buffer = Encoding.ASCII.GetBytes(Cert);
IBuffer _buffer1 = _buffer.AsBuffer();

//creating a certificate
Certificate file = new Certificate(_buffer1);
CertificateStore store = new CertificateStore();

The last line in the code throws me a constructor, has no arguments.

+4
source share

All Articles