Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnsupportedASN1TagException: Tag 175 is not supported yet #91

Open
reynaldi-lorenzo opened this issue May 29, 2023 · 1 comment
Open

Comments

@reynaldi-lorenzo
Copy link

reynaldi-lorenzo commented May 29, 2023

Hello.
I want to know, why do i keep getting this error when implementing in active project. But this doesn't occured in fresh flutter project? using same certificate, same coding like this one :

  final bytes = await file.readAsBytes();
  final results = Pkcs12Utils.parsePkcs12(bytes,
    password: password,
  );
  final data = X509Utils.x509CertificateFromPem(results[1]);
  final map = <String, String?>{};

  for (MapEntry<String, String?> entry in data.tbsCertificate!.issuer.entries) {
    map[ASN1ObjectIdentifier.fromIdentifierString(entry.key).readableName ?? '-'] = entry.value;
 }

here is P12 data , with password "R3yn4ld1L0r3nz0"

 [48, 130, 10, 25, 2, 1, 3, 48, 130, 9, 223, 6, 9, 42, 134, 72, 134, 247, 13, 1, 7, 1, 160, 130, 9, 208, 4, 130, 9, 204, 48, 130, 9, 200, 48, 130, 4, 127, 6, 9, 42, 134, 72, 134, 247, 13, 1, 7, 6, 160, 130, 4, 112, 48, 130, 4, 108, 2, 1, 0, 48, 130, 4, 101, 6, 9, 42, 134, 72, 134, 247, 13, 1, 7, 1, 48, 28, 6, 10, 42, 134, 72, 134, 247, 13, 1, 12, 1, 6, 48, 14, 4, 8, 255, 65, 228, 74, 182, 219, 239, 127, 2, 2, 8, 0, 128, 130, 4, 56, 219, 163, 246, 145, 219, 16, 253, 42, 31, 168, 240, 129, 156, 226, 82, 211, 164, 72, 74, 11, 158, 199, 29, 156, 2, 192, 111, 51, 157, 131, 142, 179, 42, 226, 114, 216, 159, 21, 52, 120, 132, 111, 117, 73, 212, 122, 125, 202, 91, 248, 41, 121, 175, 81, 78, 206, 41, 78, 172, 109, 3, 199, 117, 165, 239, 59, 162, 158, 44, 23, 32, 184, 44, 152, 156, 237, 174, 149, 87, 193, 98, 7, 250, 229, 82, 164, 233, 10, 231, 65, 167, 248, 71, 251, 249, 146, 222, 72, 171, 244, 93, 91, 251, 107, 118, 84, 66, 220, 55, 176, 252, 174, 120, 104, 67, 201, 2, 187, 62, 17, 214, 22, 159, 69, 111, 218, 69, 14, 239, 136, 86, 110, 190, 3, 109, 43, 44, 23, 8, 246, 43, 11, 250, 33, 238, 183, 9, 219, 130, 71, 205, 197, 118, 31, 173, 162, 92, 249, 186, 54, 133, 171, 237, 92, 0, 5, 112, 126, 230, 171, 167, 26, 184, 243, 130, 228, 55, 117, 62, 91, 30, 12, 83, 55, 100, 29, 4, 137, 136, 235, 244, 233, 128, 222, 132, 63, 255, 255, 146, 52, 162, 129, 125, 206, 250, 110, 53, 91, 73, 91, 144, 52, 255, 242, 203, 215, 216, 210, 140, 92, 66, 220, 174, 117, 101, 250, 161, 195, 195, 238, 204, 16, 13, 168, 160, 97, 38, 243, 124, 48, 11, 239, 98, 233, 66, 74, 103, 155, 167, 157, 15, 181, 212, 182, 119, 33, 70, 229, 205, 167, 195, 209, 146, 165, 210, 81, 139, 173, 124, 46, 178, 23, 72, 138, 95, 84, 40, 33, 105, 37, 219, 124, 250, 128, 72, 64, 230, 205, 8, 29, 159, 132, 36, 193, 137, 19, 153, 237, 22, 40, 164, 186, 58, 185, 53, 69, 61, 194, 148, 99, 160, 35, 165, 50, 169, 179, 14, 65, 106, 110, 172, 154, 109, 121, 227, 171, 201, 173, 216, 171, 220, 144, 71, 165, 90, 241, 54, 195, 150, 154, 27, 233, 199, 208, 132, 37, 17, 81, 160, 173, 246, 161, 10, 155, 207, 135, 231, 226, 93, 68, 129, 100, 37, 249, 42, 252, 130, 190, 207, 219, 38, 58, 142, 218, 203, 237, 88, 125, 129, 139, 51, 113, 54, 13, 124, 64, 31, 46, 27, 39, 168, 72, 144, 35, 168, 215, 63, 95, 16, 96, 151, 39, 182, 177, 147, 117, 236, 1, 91, 11, 179, 216, 198, 109, 216, 157, 23, 182, 32, 159, 166, 111, 88, 185, 161, 86, 116, 125, 229, 70, 165, 38, 108, 17, 109, 238, 43, 245, 149, 231, 232, 75, 233, 77, 133, 148, 198, 30, 172, 65, 230, 94, 94, 202, 176, 19, 200, 22, 190, 145, 213, 187, 210, 123, 69, 233, 161, 143, 54, 67, 153, 204, 233, 78, 139, 88, 186, 102, 213, 16, 221, 32, 93, 108, 121, 161, 198, 186, 206, 186, 41, 58, 182, 44, 208, 222, 114, 226, 42, 217, 104, 150, 46, 252, 197, 173, 232, 6, 31, 148, 210, 23, 34, 105, 77, 249, 222, 30, 213, 219, 59, 155, 40, 84, 121, 64, 221, 237, 19, 217, 73, 120, 230, 210, 179, 47, 123, 211, 83, 17, 222, 112, 128, 88, 196, 155, 119, 135, 69, 162, 21, 240, 194, 232, 27, 29, 213, 100, 80, 111, 137, 220, 103, 115, 226, 122, 80, 254, 13, 153, 20, 204, 125, 236, 63, 60, 161, 87, 50, 192, 178, 31, 195, 39, 191, 88, 68, 198, 237, 133, 23, 25, 39, 227, 29, 88, 116, 236, 54, 252, 15, 216, 205, 150, 79, 181, 246, 207, 106, 96, 207, 240, 174, 34, 77, 104, 30, 163, 156, 46, 173, 51, 235, 115, 236, 50, 95, 132, 170, 27, 122, 50, 104, 251, 110, 167, 100, 8, 150, 34, 53, 15, 224, 232, 48, 226, 140, 9, 85, 128, 177, 146, 56, 32, 240, 141, 232, 107, 173, 202, 31, 90, 14, 91, 8, 51, 140, 81, 50, 32, 93, 149, 28, 47, 60, 28, 214, 14, 150, 175, 71, 238, 25, 71, 224, 82, 74, 92, 213, 57, 136, 216, 46, 91, 209, 35, 155, 52, 254, 200, 136, 33, 99, 167, 212, 159, 92, 130, 152, 209, 181, 169, 156, 186, 65, 88, 43, 2, 193, 87, 34, 158, 28, 24, 33, 33, 110, 131, 231, 135, 63, 181, 67, 35, 23, 119, 159, 39, 50, 242, 61, 97, 229, 153, 107, 237, 221, 106, 88, 202, 171, 232, 40, 110, 144, 2, 100, 144, 53, 97, 108, 225, 207, 31, 254, 146, 192, 7, 85, 66, 247, 189, 186, 110, 0, 22, 40, 109, 251, 90, 250, 18, 140, 165, 146, 13, 15, 159, 116, 102, 245, 130, 141, 135, 159, 36, 31, 13, 224, 87, 204, 113, 251, 134, 15, 187, 34, 58, 37, 194, 0, 56, 184, 5, 234, 197, 87, 74, 87, 143, 215, 130, 1, 186, 191, 184, 24, 28, 119, 176, 23, 119, 185, 230, 176, 104, 191, 106, 254, 220, 250, 192, 145, 15, 187, 95, 44, 8, 134, 24, 41, 110, 70, 174, 142, 80, 86, 150, 109, 140, 124, 240, 158, 154, 164, 67, 140, 200, 138, 17, 134, 17, 48, 216, 1, 192, 140, 230, 72, 75, 24, 213, 37, 46, 190, 67, 206, 138, 131, 99, 249, 203, 108, 2, 62, 162, 31, 42, 110, 245, 163, 90, 18, 208, 144, 33, 153, 137, 85, 11, 43, 160, 200, 77, 117, 167, 123, 104, 129, 109, 190, 68, 154, 95, 20, 13, 169, 72, 8, 152, 184, 95, 123, 15, 99, 71, 164, 156, 233, 72, 196, 164, 215, 111, 27, 100, 81, 183, 146, 32, 21, 101, 48, 152, 162, 84, 132, 201, 166, 80, 146, 101, 168, 227, 106, 45, 214, 181, 179, 115, 27, 154, 76, 229, 116, 59, 14, 188, 149, 9, 4, 8, 100, 188, 125, 198, 48, 216, 119, 189, 4, 225, 100, 207, 173, 86, 213, 120, 166, 226, 72, 203, 75, 45, 195, 40, 197, 89, 22, 240, 231, 220, 104, 29, 161, 228, 253, 76, 90, 132, 231, 67, 48, 87, 141, 178, 97, 200, 165, 218, 51, 221, 72, 31, 131, 208, 155, 51, 134, 106, 62, 76, 79, 23, 98, 217, 38, 40, 75, 197, 185, 228, 236, 146, 32, 32, 164, 234, 180, 136, 142, 92, 41, 231, 176, 164, 23, 121, 137, 253, 183, 231, 99, 228, 170, 182, 225, 178, 17, 246, 48, 130, 5, 65, 6, 9, 42, 134, 72, 134, 247, 13, 1, 7, 1, 160, 130, 5, 50, 4, 130, 5, 46, 48, 130, 5, 42, 48, 130, 5, 38, 6, 11, 42, 134, 72, 134, 247, 13, 1, 12, 10, 1, 2, 160, 130, 4, 238, 48, 130, 4, 234, 48, 28, 6, 10, 42, 134, 72, 134, 247, 13, 1, 12, 1, 3, 48, 14, 4, 8, 136, 140, 81, 96, 135, 44, 128, 9, 2, 2, 8, 0, 4, 130, 4, 200, 18, 202, 45, 70, 95, 118, 241, 195, 177, 187, 220, 1, 57, 246, 78, 98, 224, 28, 155, 7, 237, 41, 217, 146, 116, 43, 243, 228, 187, 42, 152, 226, 156, 201, 132, 196, 243, 113, 130, 90, 0, 248, 29, 133, 93, 231, 36, 85, 43, 248, 118, 184, 73, 69, 33, 141, 207, 47, 31, 3, 93, 122, 191, 163, 173, 55, 73, 147, 148, 250, 105, 240, 194, 198, 32, 44, 130, 167, 89, 70, 244, 171, 80, 109, 156, 134, 117, 61, 247, 77, 128, 208, 241, 132, 211, 120, 17, 7, 88, 246, 188, 236, 142, 31, 249, 141, 126, 149, 92, 243, 157, 138, 215, 192, 58, 108, 231, 5, 17, 122, 110, 109, 102, 9, 84, 125, 205, 90, 238, 109, 183, 3, 77, 122, 43, 237, 150, 234, 180, 104, 59, 240, 175, 90, 175, 224, 188, 202, 142, 134, 151, 221, 77, 18, 173, 1, 253, 74, 223, 48, 40, 97, 41, 226, 126, 147, 244, 37, 205, 161, 156, 35, 203, 98, 220, 97, 57, 128, 202, 91, 148, 55, 68, 18, 144, 162, 52, 84, 40, 41, 215, 25, 65, 7, 212, 105, 204, 181, 202, 116, 220, 115, 198, 158, 235, 142, 81, 20, 249, 64, 172, 9, 197, 20, 172, 79, 116, 108, 212, 141, 63, 146, 115, 7, 144, 184, 23, 36, 51, 8, 198, 233, 41, 214, 93, 223, 194, 2, 209, 85, 124, 142, 243, 229, 171, 134, 148, 227, 137, 88, 205, 38, 40, 200, 220, 138, 82, 22, 227, 231, 118, 122, 30, 129, 19, 101, 144, 8, 232, 223, 112, 115, 110, 120, 158, 245, 127, 104, 38, 62, 135, 19, 51, 213, 114, 29, 199, 222, 185, 155, 181, 106, 253, 65, 106, 215, 18, 125, 199, 188, 27, 103, 20, 137, 17, 245, 190, 9, 225, 13, 52, 169, 151, 225, 235, 159, 96, 56, 74, 244, 115, 230, 3, 57, 26, 241, 159, 116, 67, 53, 159, 184, 98, 157, 203, 86, 77, 132, 164, 99, 146, 139, 130, 233, 21, 57, 87, 183, 148, 47, 108, 24, 25, 86, 115, 93, 164, 133, 171, 122, 128, 105, 226, 32, 162, 168, 40, 35, 32, 29, 31, 15, 129, 187, 174, 237, 52, 227, 37, 125, 224, 101, 230, 68, 96, 167, 55, 192, 146, 196, 120, 207, 28, 82, 234, 147, 188, 201, 210, 79, 59, 219, 252, 102, 77, 33, 217, 196, 106, 118, 203, 22, 187, 158, 98, 117, 3, 139, 172, 231, 43, 74, 216, 62, 188, 110, 240, 111, 8, 171, 154, 202, 220, 215, 109, 177, 99, 114, 159, 89, 249, 221, 106, 228, 94, 1, 44, 60, 139, 191, 109, 185, 19, 46, 63, 84, 210, 150, 113, 161, 42, 181, 229, 86, 106, 102, 107, 103, 18, 240, 88, 158, 112, 18, 182, 211, 13, 165, 26, 70, 241, 236, 176, 176, 223, 60, 217, 140, 164, 246, 191, 195, 104, 63, 133, 70, 170, 12, 79, 210, 40, 26, 162, 111, 88, 22, 91, 7, 12, 60, 165, 124, 153, 66, 3, 78, 180, 85, 252, 82, 10, 70, 34, 252, 245, 176, 159, 159, 0, 200, 43, 214, 31, 120, 26, 76, 89, 108, 208, 124, 88, 227, 172, 140, 100, 142, 137, 149, 90, 69, 16, 84, 225, 10, 238, 236, 65, 230, 45, 103, 84, 115, 160, 103, 134, 90, 103, 29, 22, 236, 180, 183, 33, 71, 121, 170, 218, 70, 43, 9, 217, 19, 160, 78, 162, 8, 112, 111, 144, 223, 152, 151, 221, 40, 216, 28, 51, 45, 135, 197, 189, 227, 76, 80, 234, 110, 27, 6, 135, 105, 102, 4, 140, 138, 115, 237, 167, 95, 26, 48, 146, 11, 204, 20, 12, 40, 50, 249, 132, 185, 218, 177, 130, 206, 62, 90, 218, 251, 138, 41, 46, 68, 124, 121, 21, 117, 168, 25, 24, 157, 44, 60, 90, 197, 58, 251, 6, 4, 218, 205, 199, 202, 240, 94, 216, 94, 43, 166, 49, 221, 142, 12, 33, 85, 93, 172, 94, 7, 96, 104, 200, 5, 93, 232, 174, 170, 185, 13, 155, 119, 60, 18, 73, 72, 18, 220, 168, 153, 164, 16, 216, 160, 172, 1, 157, 2, 70, 176, 42, 213, 9, 108, 19, 160, 18, 184, 189, 101, 110, 180, 20, 187, 39, 152, 221, 51, 6, 204, 177, 215, 9, 84, 179, 213, 148, 133, 40, 25, 173, 183, 165, 67, 14, 95, 48, 174, 79, 239, 3, 34, 249, 230, 94, 112, 187, 3, 1, 156, 71, 151, 245, 244, 128, 189, 160, 165, 171, 169, 162, 203, 233, 31, 44, 11, 18, 66, 60, 15, 207, 60, 121, 227, 200, 22, 193, 240, 84, 152, 165, 153, 161, 216, 66, 194, 226, 236, 122, 101, 97, 29, 252, 80, 13, 90, 142, 170, 8, 48, 125, 176, 140, 62, 109, 87, 3, 234, 167, 56, 56, 208, 222, 35, 122, 66, 40, 162, 100, 68, 184, 241, 245, 38, 131, 189, 90, 203, 79, 227, 98, 242, 163, 200, 32, 119, 184, 131, 53, 188, 222, 214, 157, 248, 9, 114, 84, 45, 178, 192, 120, 96, 230, 228, 203, 99, 139, 49, 238, 138, 57, 134, 113, 73, 74, 189, 80, 27, 180, 245, 34, 30, 47, 55, 203, 17, 100, 201, 79, 216, 128, 172, 108, 101, 217, 144, 166, 77, 69, 64, 180, 197, 17, 96, 239, 50, 231, 177, 224, 132, 120, 189, 197, 65, 113, 87, 59, 21, 184, 110, 93, 24, 136, 240, 74, 216, 232, 26, 232, 29, 165, 247, 244, 218, 15, 119, 60, 255, 144, 3, 134, 90, 164, 209, 161, 106, 242, 41, 176, 78, 73, 164, 147, 1, 120, 156, 193, 17, 16, 205, 54, 209, 99, 199, 143, 174, 1, 160, 17, 191, 82, 37, 241, 237, 80, 159, 200, 161, 239, 139, 143, 179, 147, 129, 131, 15, 253, 51, 214, 231, 219, 84, 30, 194, 206, 41, 164, 59, 188, 139, 87, 87, 38, 15, 120, 250, 249, 108, 70, 164, 128, 16, 5, 178, 47, 185, 52, 20, 35, 14, 215, 157, 53, 248, 70, 199, 190, 206, 27, 79, 98, 226, 162, 181, 116, 122, 158, 255, 79, 43, 31, 245, 197, 217, 237, 133, 166, 112, 129, 26, 135, 203, 20, 39, 14, 192, 118, 10, 153, 12, 253, 17, 187, 243, 37, 118, 195, 149, 64, 15, 13, 157, 25, 110, 224, 232, 216, 124, 37, 194, 48, 57, 229, 158, 148, 30, 60, 25, 1, 64, 94, 4, 31, 178, 100, 72, 62, 114, 33, 187, 97, 51, 192, 219, 4, 195, 124, 205, 27, 212, 239, 67, 157, 201, 108, 175, 174, 10, 42, 184, 115, 25, 157, 252, 253, 247, 87, 110, 13, 110, 34, 241, 52, 244, 174, 28, 54, 239, 170, 250, 193, 66, 35, 30, 68, 27, 23, 72, 202, 92, 181, 101, 210, 120, 112, 43, 63, 45, 183, 166, 85, 168, 11, 96, 38, 34, 208, 18, 182, 129, 131, 40, 247, 235, 178, 195, 33, 121, 224, 6, 121, 131, 187, 39, 74, 152, 34, 81, 161, 71, 224, 143, 190, 232, 109, 146, 129, 8, 80, 54, 94, 111, 77, 53, 100, 130, 109, 143, 61, 244, 107, 160, 182, 171, 68, 101, 67, 227, 209, 42, 248, 131, 55, 170, 225, 246, 49, 37, 48, 35, 6, 9, 42, 134, 72, 134, 247, 13, 1, 9, 21, 49, 22, 4, 20, 96, 230, 184, 37, 253, 224, 163, 146, 170, 57, 102, 255, 242, 70, 5, 0, 188, 71, 250, 170, 48, 49, 48, 33, 48, 9, 6, 5, 43, 14, 3, 2, 26, 5, 0, 4, 20, 197, 189, 43, 115, 152, 44, 159, 129, 165, 4, 86, 33, 110, 146, 142, 241, 197, 78, 241, 226, 4, 8, 172, 240, 132, 84, 64, 143, 243, 44, 2, 2, 8, 0]

I/flutter ( 8757): UnsupportedASN1TagException: Tag 175 is not supported yet
I/flutter ( 8757): #0 ASN1Parser._createConstructed (package:pointycastle/asn1/asn1_parser.dart:116:9)
I/flutter ( 8757): #1 ASN1Parser.nextObject (package:pointycastle/asn1/asn1_parser.dart:77:13)
I/flutter ( 8757): #2 new ASN1Sequence.fromBytes (package:pointycastle/asn1/primitives/asn1_sequence.dart:28:28)
I/flutter ( 8757): #3 Pkcs12Utils.parsePkcs12 (package:basic_utils/src/pkcs12_utils.dart:657:32)

@Ephenodrom
Copy link
Owner

Ephenodrom commented May 30, 2023

Hello and thank you for the issue. The "parse" method is not yet finished and therefore there are still some bugs left. If time permits I will work on it and finish it. Currently it supports only the same algorithms that can be used in the generatePkcs12() method. I assume that the error comes up due to the PKCS12 you tried to parse was encrypted with AES, that is currently not supported or it is something else that is related to the fact that the "parsing logic" is not yet finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants