To get the digital signature information of a Delphi application, you can use the TWinCertificate class from the Winapi.WinTrust unit of the Delphi RTL. This class provides properties and methods that allow you to access the digital signature of the application, including the signature timestamp, subject name, and issuer name.
Here is an example of how you can use the TWinCertificate class in Delphi to get the digital signature information of an application;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
uses System.SysUtils, Winapi.WinTrust; var Certificate TWinCertificate; begin Certificate = TWinCertificate.Create(ParamStr(0)); try //Get the signature timestamp Writeln(‘Signature Timestamp ‘, Certificate.SignatureTime); //Get the subject name Writeln(‘Subject Name ‘, Certificate.SubjectName); //Get the issuer name Writeln(‘Issuer Name ‘, Certificate.IssuerName); finally Certificate.Free; end; end. |
This code sample uses the TWinCertificate class to get the digital signature information of the application specified on the command line. You can use the other properties and methods of this class to access more detailed information about the digital signature, such as the serial number, thumbprint, and certificate chain. For more information, please refer to the Delphi documentation and the TWinCertificate class reference.
Leave a Reply