parsePkcs12Pure method

Pkcs12Bundle parsePkcs12Pure(
  1. Uint8List der, {
  2. String password = '',
})
inherited

Opens a PKCS#12/PFX with the pure Dart decoder: no OpenSSL in the decryption path and no need for the legacy provider.

The resulting key and certificates are loaded into OpenSSL afterwards, so the return value is the same Pkcs12Bundle as parsePkcs12. Useful where the legacy module is not installed (containers, slim images) and the file uses RC2/RC4 — see decodePkcs12Pure.

Implementation

Pkcs12Bundle parsePkcs12Pure(Uint8List der, {String password = ''}) {
  final pure = decodePkcs12Pure(der, password: password);
  final openssl = this as OpenSSL;

  return Pkcs12Bundle(
    privateKey: openssl.loadPrivateKeyPem(pure.privateKeyPem),
    certificate: openssl.loadCertificatePem(pure.certificatePem),
    caCertificates:
        pure.chainPem.map(openssl.loadCertificatePem).toList(growable: false),
  );
}