Sample code for 30+ languages & platforms
Dart Requires Chilkat v10.1.2+

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 Dart Downloads

Dart
import 'package:chilkat/chilkat.dart';

void main() {
  final certStore = CkCertStore();

  // The "AddressBook" is the "Other People" certificate store as shown in certmgr.msc
  final readOnly = true;
  try {
    certStore.openWindowsStore('CurrentUser', 'AddressBook', readOnly);
  } on ChilkatException catch (e) {
    print(e.lastErrorText);
    return;
  }

  // Find the certificate for the email address:
  final jsonE = CkJsonObject();
  jsonE.updateString('email', 'joe@example.com');

  final cert = CkCert();
  try {
    certStore.findCert(jsonE, cert);
  } on ChilkatException catch (e) {
    print(e.lastErrorText);
    return;
  }

  print('Found certificate: ${cert.subjectDN}');
}