Dart-Basic-Utils icon indicating copy to clipboard operation
Dart-Basic-Utils copied to clipboard

throw exception

Open hply opened this issue 2 years ago • 1 comments

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

hply avatar Mar 29 '23 12:03 hply

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.

Ephenodrom avatar Mar 29 '23 18:03 Ephenodrom