Skip to content

Unable to parse Code Signing Certificate for Microsoft #34

@tehmoon

Description

@tehmoon

Hi!

First off, many thanks for taking the time to do this useful lib!!

For a side project, I was trying to parse certificates inside exe files -- PE format -- to get the expiration date.

I'll skip the details on how to do it, but it turns out it's using PKCS7 format to store the certificate chain, hence the use of this lib.

When I call Parse() with the payload in DER this is what I get:

structure error: tags don't match (4 vs {class:0 tag:16 length:23 isCompound:true}) {optional:false explicit:false application:false defaultValue:<nil> tag:<nil> stringType:0 timeType:0 set:false omitEmpty:false} unsignedData @2

I had to patch the library and can make a PR if that's necessary: tehmoon@8f12946

As you can see, I de-serialize using RawValue and passing the underlying bytes. I didn't dig much further so I have no idea what's wrong.

I've attached the pkcs7 data in hex string format: data.hex.txt

Even though the patch works well for me, I thought about opening an issue to contribute a little bit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions