checkPkcs12CertificatePassword static method

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

Checks whether password opens the PKCS#12 certificate at path.

Call this before loadPkcs12Certificate to keep an invalid password in the current input flow instead of attempting to load certificate metadata.

example:

final isValid = await ComPDFKit.checkPkcs12CertificatePassword(
  '/path/to/certificate.p12',
  'certificate-password',
);
if (isValid) {
  // The certificate can be loaded safely.
}

Implementation

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