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

List Certificates in the Current User Certificate Store (Windows Only)

See more Certificates Examples

This is a Windows-only example to list the certificates in the current-user certificate store (located in the Windows Registry).

Chilkat Dart Downloads

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

void main() {
  // This is a Windows-only example because it lists the certificates
  // stored in the Windows Current User Certificate Store located in the
  // Windows Registry.

  final certStore = CkCertStore();

  final readOnly = true;
  try {
    certStore.openCurrentUserStore(readOnly);
  } on ChilkatException catch (e) {
    print(e.lastErrorText);
    return;
  }

  final cert = CkCert();
  final numCerts = certStore.numCertificates;
  var i = 0;
  while (i < numCerts) {
    certStore.getCert(i, cert);
    print('DN = ${cert.subjectDN}');
    print('Email = ${cert.subjectE}');
    i++;
  }
}