Reputation: 47
Is it possible to extract the digital signature certificate from a sys driver file by command line?
Either using 3rd party tool or built in windows tools?
Thanks
Upvotes: 4
Views: 3287
Reputation: 73
Using powershell it's quite easy:
$driverFile = 'C:\temp\myDriver.sys';
$outputFile = 'C:\temp\output.cer';
$exportType = [System.Security.Cryptography.X509Certificates.X509ContentType]::Cert;
$cert = (Get-AuthenticodeSignature $driverFile).SignerCertificate;
[System.IO.File]::WriteAllBytes($outputFile, $cert.Export($exportType));
Upvotes: 7