473,804 Members | 3,330 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I determine if a Windows Driver is Digitally signed

Hey all.

I need to determine whether or not a Windows Driver is digitally
signed using a C# application. Can anyone point me in the right
direction for doing this? I know it has something to do with the .cat
file, but I'm not sure exactly what else I need to do.

TIA!
Mar 13 '08 #1
2 3933
"Rymfax" <cw*****@bigban gllc.comwrote in message
news:71******** *************** ***********@n75 g2000hsh.google groups.com...
Hey all.

I need to determine whether or not a Windows Driver is digitally
signed using a C# application. Can anyone point me in the right
direction for doing this? I know it has something to do with the .cat
file, but I'm not sure exactly what else I need to do.

TIA!

If the driver file is signed, then it should contain a valid X509
certificate, so one way to check this is by using using the
System.Security .Cryptography.X 509Certificates namespace.
Here a small snip to get you started..

using System;
using System.Security .Cryptography;
using System.Security .Cryptography.X 509Certificates ;
....

X509Certificate certp =
X509Certificate 2.CreateFromSig nedFile(@"C:\Wi ndows\System32\ drivers\tcpip.s ys");
X509Certificate 2 x509 = new X509Certificate 2(certp.Handle) ;
// if valid, dump some properties to the console
Console.WriteLi ne("{0}Subject : {1}{0}",
Environment.New Line,x509.Subje ct);
Console.WriteLi ne("{0}Issuer: {1}{0}", Environment.New Line,x509.Issue r);
Console.WriteLi ne("{0}Version : {1}{0}",
Environment.New Line,x509.Versi on);
Console.WriteLi ne("{0}Valid Date: {1}{0}",
Environment.New Line,x509.NotBe fore);
Console.WriteLi ne("{0}Expiry Date: {1}{0}",
Environment.New Line,x509.NotAf ter);
Console.WriteLi ne("{0}Thumbpri nt: {1}{0}",
Environment.New Line,x509.Thumb print);
Console.WriteLi ne("{0}Serial Number: {1}{0}",
Environment.New Line,x509.Seria lNumber);
Console.WriteLi ne("{0}Friendl y Name: {1}{0}",
Environment.New Line,x509.Publi cKey.Oid.Friend lyName);
Console.WriteLi ne("{0}Public Key Format: {1}{0}",
Environment.New Line,x509.Publi cKey.EncodedKey Value.Format(tr ue));
Console.WriteLi ne("{0}Raw Data Length: {1}{0}",
Environment.New Line,x509.RawDa ta.Length);
Console.WriteLi ne("{0}Certific ate to string: {1}{0}",
Environment.New Line,x509.ToStr ing(true));

Willy.

Mar 13 '08 #2
On Mar 13, 4:42*pm, "Willy Denoyette [MVP]"
<willy.denoye.. .@telenet.bewro te:
"Rymfax" <cwal...@bigban gllc.comwrote in message

news:71******** *************** ***********@n75 g2000hsh.google groups.com...
Hey all.
I need to determine whether or not a Windows Driver is digitally
signed using a C# application. *Can anyone point me in the right
direction for doing this? *I know it has something to do with the .cat
file, but I'm not sure exactly what else I need to do.
TIA!

If the driver file is signed, then it should contain a valid X509
certificate, so one way to check this is by using using the
System.Security .Cryptography.X 509Certificates namespace.
Here a small snip to get you started..

using System;
using System.Security .Cryptography;
using System.Security .Cryptography.X 509Certificates ;
...

* *X509Certificat e certp =
X509Certificate 2.CreateFromSig nedFile(@"C:\Wi ndows\System32\ drivers\tcpip.s *ys");
* *X509Certificat e2 x509 = new X509Certificate 2(certp.Handle) ;
* *// if valid, dump some properties to the console
* *Console.WriteL ine("{0}Subject : {1}{0}",
Environment.New Line,x509.Subje ct);
* *Console.WriteL ine("{0}Issuer: {1}{0}", Environment.New Line,x509.Issue r);
* *Console.WriteL ine("{0}Version : {1}{0}",
Environment.New Line,x509.Versi on);
* *Console.WriteL ine("{0}Valid Date: {1}{0}",
Environment.New Line,x509.NotBe fore);
* *Console.WriteL ine("{0}Expiry Date: {1}{0}",
Environment.New Line,x509.NotAf ter);
* *Console.WriteL ine("{0}Thumbpr int: {1}{0}",
Environment.New Line,x509.Thumb print);
* *Console.WriteL ine("{0}Serial Number: {1}{0}",
Environment.New Line,x509.Seria lNumber);
* *Console.WriteL ine("{0}Friendl y Name: {1}{0}",
* * * * Environment.New Line,x509.Publi cKey.Oid.Friend lyName);
* *Console.WriteL ine("{0}Public Key Format: {1}{0}",
* * * * *Environment.Ne wLine,x509.Publ icKey.EncodedKe yValue.Format(t rue));
* *Console.WriteL ine("{0}Raw Data Length: {1}{0}",
Environment.New Line,x509.RawDa ta.Length);
* *Console.WriteL ine("{0}Certifi cate to string: {1}{0}",
Environment.New Line,x509.ToStr ing(true));

Willy.
You Rock Willy! That worked perfectly...THA NKS!
Mar 14 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1449
by: Aaron | last post by:
How and where do I get my application signed so that when downloading from SP2 it will say my app is signed. Thanks, Aaron
0
1160
by: CLarkou | last post by:
My program in Office 2003 has digitally signed databases. My security is medium. I have 1 database (MDE) without any data. Program makes a copy of this empty database (signed) to a new directory that the user selects and with VBA (same system.mdw) I am changing some data in the tables. After this the signature is removed. Why this is happening ? I am not going to change tables' structure, I just want to update the tables data. Is this a...
1
1998
by: Peter Wyss | last post by:
Hello, Does anyone have any Information, Turtorials, FAQ's or Websites about Digitally signed Office Add-Ins written in C#? Thanks for the help, Peter Wyss
1
2755
by: Gaurav Kapoor via .NET 247 | last post by:
Hi, Prob : I want to send an email which is digitally signed over SMTP. Env: I am developing this on .NET and referencing the CDO library (Interop) to send the mail. I havent found any hints on this anywhere. It would be great if some one can give any pointers Thank you. -------------------------------- From: Gaurav Kapoor
7
1641
by: Z-Z | last post by:
Hi, I used the following macro to determine variable signed or not, but only find that it is useless for a short or char variable. I think that it might caused by value conversion rules. I used VC. #define ISUNSIGNED(a) (a>=0 && ~a>= 0) Who knows the reason and other methods to determine short varible signed or not?
4
4642
by: Chris | last post by:
How do we create digitally signed MDE files in Access 2007 ? I tried to follow the procedure I was using in other office versions. 1. I installed the Verisign certificate (with private key). 2. Signed the MDB from VBA. 3. Create the MDE. When I try to open the signed MDE, even on the developement machine with
1
4454
by: Ralf | last post by:
Situation: .NET windows service All works fine until we digitally signed the service exe. After that starting the service often fails (A timeout was reached (30000 milliseconds) while waiting for the ... service to connect.). I can reproduce this behaviour with XP x64. Looks like windows tries to verify the signature and this take too much time. When I disconnect the computer from the internet, the service starts.
2
3052
by: ricovox | last post by:
Hi, What is the best IDE for Windows Driver Development? Should I just find a generic C/C++ compiler? Can I compile a Windows Driver using Managed C++ (.NET), or must I use VC++ 6 etc? Thanks very much for all opinions. Richard
0
1406
by: =?Utf-8?B?amZiZXJtZWpvcA==?= | last post by:
How can I send an email using System.Net.Mail digitally signed? -- Jose
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10326
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.