Created
March 16, 2016 13:42
-
-
Save margusmartsepp/12373ac6cda7b6a43b2c to your computer and use it in GitHub Desktop.
install root certificate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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