React Native Requires Chilkat v10.1.2+
React Native
Find a Certificate in the "Other People" Windows Certificate Store
See more Certificates Examples
Demonstrates how to open the "Current User --> Other People" Windows certificate store, and locates a certificate matching an email address.Chilkat React Native Downloads
import { Cert, CertStore, JsonObject } from '@chilkat/react-native'
function chilkatExample() {
const certStore = new CertStore();
// The "AddressBook" is the "Other People" certificate store as shown in certmgr.msc
const readOnly = true;
try {
certStore.openWindowsStore('CurrentUser', 'AddressBook', readOnly);
} catch {
console.log(certStore.lastErrorText);
return;
}
// Find the certificate for the email address:
const jsonE = new JsonObject();
jsonE.updateString('email', 'joe@example.com');
const cert = new Cert();
try {
certStore.findCert(jsonE, cert);
} catch {
console.log(certStore.lastErrorText);
return;
}
console.log(`Found certificate: ${cert.subjectDN}`);
}