macOS/iOS SecKeyChain
Ángel Rubén Valdeolmos Carmona
586
Reputation points
I'm trying to access the keychain to get the installed certificates, but it always returns null, I don't see the option to enable KeyChain Info.plist, I don't see the entitlements.plist file in net maui.
I installed the pfx certificate on my macOS, but in the code output it says "item not found".
a custom provisioning profile is needed?
SecRecord rec = new(SecKind.Certificate);
SecStatusCode code;
SecKeyChain.QueryAsRecord(rec, out code);
NSData[] nsDatas = SecKeyChain.QueryAsData(rec, false, 999, out code);
if (nsDatas != null)
{
foreach (NSData item in nsDatas)
{
X509Certificate2 cert = new X509Certificate2(item.ToArray());
x509Certificate2s.Add(cert);
}
}
Sign in to answer