i want know if there command list information can found in digital signatures section of properties of .exe. particularly want able grab name of signer. there command generate information me?
to subject name signer certificate used create authenticode signature, use get-authenticodesignature
:
ps > $asig = get-authenticodesignature 'c:\windows\system32\xcopy.exe' ps > $asig.signercertificate.subject cn=microsoft windows, o=microsoft corporation, l=redmond, s=washington, c=us
you're interested in common name (cn), , maybe organization name (o). can parse distinguished name subject components common name:
ps > $asig = get-authenticodesignature 'c:\windows\system32\xcopy.exe' ps > $dndict = ($asig.signercertificate.subject -split ', ') | foreach ` { $dndict = @{} } ` { $item = $_.split('='); $dndict[$item[0]] = $item[1] } ` { $dndict } ps > $dndict['cn'] microsoft windows ps > $dndict['o'] microsoft corporation
Comments
Post a Comment