toTrustStore method

PdfTrustStore toTrustStore()

A trust store anchored at every entry.

Implementation

PdfTrustStore toTrustStore() {
  final store = PdfTrustStore();
  final seen = <String>{};
  for (final e in entries) {
    if (seen.add(base64.encode(e.certificate))) {
      try {
        store.addDer(e.certificate, source: PdfEuLotl.sourceName);
      } on Object {
        // an unparsable certificate is not an anchor
      }
    }
  }
  return store;
}