Skip to content

Instantly share code, notes, and snippets.

@margusmartsepp
Created March 16, 2016 13:42
Show Gist options
  • Save margusmartsepp/12373ac6cda7b6a43b2c to your computer and use it in GitHub Desktop.
Save margusmartsepp/12373ac6cda7b6a43b2c to your computer and use it in GitHub Desktop.
install root certificate
public static class RootCertificates
{
public static async void AddEsteidSk()
{
try
{
var certificateFile = new Uri("ms-appx:///Assets/ESTEID-SK_2015.der.crt");
var file = await StorageFile.GetFileFromApplicationUriAsync(certificateFile);
var certBlob = await FileIO.ReadBufferAsync(file);
var trustedStore = CertificateStores.TrustedRootCertificationAuthorities;
var rootCert = new Certificate(certBlob);
trustedStore.Add(rootCert);
}
catch (Exception ex)
{
throw new DigiDocException("Could not add EsteidSK root cert", ex);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment