addTrustedCertificate static method

Future<bool> addTrustedCertificate(
  1. String path,
  2. String password
)

Adds a PKCS#12 certificate to the application trust store.

Reload the certificate with loadPkcs12Certificate after this call to obtain the updated CPDFCertificateInfo.isTrusted state.

example:

final trusted = await ComPDFKit.addTrustedCertificate(
  '/path/to/certificate.p12',
  'certificate-password',
);
if (trusted) {
  final certificate = await ComPDFKit.loadPkcs12Certificate(
    '/path/to/certificate.p12',
    'certificate-password',
  );
  print(certificate?.isTrusted);
}

Implementation

static Future<bool> addTrustedCertificate(
    String path, String password) async {
  return await _methodChannel.invokeMethod(
    'add_trusted_certificate',
    <String, String>{'path': path, 'password': password},
  );
}