简体   繁体   中英

How can I find the public key of any PE file?

I want to verify the digital signature of any PE file (exe, dll) in Java. So, I need to find the public key and the signature of these files. Can you please help ?!

There's a good discussion here , which will be easier to understand if you have a background on the PE file format (there's a good intro here ) but to summarise:

  • There's a pointer at offset 24 in the file header to the PE header
  • The PE header is 116 bytes long and is immediately followed by the data directory
  • There's a pointer at offset 32 of the data directory to the start of the security data
  • The security data is an array of resource objects, each of which contains an ASN.1 encoded certificate
  • The resource object consists of a length field (4 bytes), a version number (2 bytes), a certificate type field (2 bytes), then the raw data of the certificate

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM