Home Xamarin/Visual Studio on Mac - iPhone - Not able to list X509Store certificates
Reply: 0

Xamarin/Visual Studio on Mac - iPhone - Not able to list X509Store certificates

user1242
1#
user1242 Published in July 20, 2018, 5:05 am

Environment Device: . iPhone6s

Development Environment: .net Standard 1.5, Visual Studio on Mac Community Version 7.2.2 (build 7), Xamarin

I have the following code to get/list Certificates that are installed on my iPhone. I have not been successful so far – I get an empty collection when I use the code below.

I am running the code on the iPhone using a development provisioning profile.

I have 2 projects a portable Project and an iOS project. The Code listed below is in the Portable Class library.

using System;
using System.Collections.Generic;
using Xamarin.Forms;

using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;

    X509Store paramStore 

    paramStore  = new X509Store(StoreName.My, StoreLocation.CurrentUser) 

    paramStore.Open(OpenFlags.ReadOnly); 
    foreach (X509Certificate2 mCert in paramStore.Certificates)
    {
     numberOfCertificates = numberOfCertificates + 1;

    }

I have also tried accessing StoreName.Root, StoreName.CertificateAuthority along with variations of OpenFlags e.g. .ReadWrite - same result no data.

Looking for input/thoughts.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.305811 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO