Ephenodrom / Dart-Basic-Utils

A dart package for many helper methods fitting common situations
MIT License
368 stars 79 forks source link

throw exception #88

Open hply opened 1 year ago

hply commented 1 year ago

Unhandled exception: Invalid argument(s): unsupported algorithm

0 Pkcs12Utils._algorithmFromOi (package:basic_utils/src/pkcs12_utils.dart:764:9)

1 Pkcs12Utils.parsePkcs12. (package:basic_utils/src/pkcs12_utils.dart:694:45)

2 List.forEach (dart:core-patch/growable_array.dart:416:8)

3 Pkcs12Utils.parsePkcs12 (package:basic_utils/src/pkcs12_utils.dart:672:35)

debug the '_algorithmFromOi',print my pkcs12's keyPbe=1.2.840.113549.1.5.13.

test file: https://github.com/hply/file/blob/main/keystore.p12 password: pkcs12_test

Ephenodrom commented 1 year ago

The .p12 file uses aes256-CBC to encrypt the keys and the certs. This is currently not supported by this package, but it AES support is on the list.

If you check out the code doc for the generatePkcs12() you can see the supported algorithms.

  /// Possible values for keyPbe and certPbe:
  /// * PBE-SHA1-RC4-128
  /// * PBE-SHA1-RC4-40
  /// * PBE-SHA1-3DES ( default for keyPbe )
  /// * PBE-SHA1-2DES
  /// * PBE-SHA1-RC2-128
  /// * PBE-SHA1-RC2-40 ( default for certPbe)

The parsePkcs12() method is still BETA, so thats why there is no code doc.

The issue will stay opened until AES is supported.