Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Security / December 2006

Tip: Looking for answers? Try searching our database.

Extract Public Key From certificate and RSACryptoServiceProvider

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
msnews.microsoft.com - 09 Dec 2006 15:45 GMT
I am using .NET Framework 2.0. I used X509Certificate class to obtain the
public key from a certificate file.

       // The path to the certificate.
       string Certificate = "C:\\Certificate.cer";

       // Load the certificate into an X509Certificate object.
       X509Certificate cert = new X509Certificate(Certificate);

       byte[] key = cert.GetPublicKey();

My question is how do i use the key to instantiate data to instantiate
RSACryptoServiceProvider. I need this in order to verify a signature
received from a client machine.

Thanks.
Dominick Baier - 09 Dec 2006 16:02 GMT
Hi,

use the X509Certificate2 class - The public/private Property returns a RSACryptoServiceProvider...

-----
Dominick Baier (http://www.leastprivilege.com)

> I am using .NET Framework 2.0. I used X509Certificate class to obtain
> the public key from a certificate file.
[quoted text clipped - 10 lines]
>
> Thanks.
msnews.microsoft.com - 09 Dec 2006 17:22 GMT
Hi,

I couldn't find such property in X509Certificate2.

> Hi,
> use the X509Certificate2 class - The public/private Property returns a
[quoted text clipped - 17 lines]
>>
>> Thanks.
Joe Kaplan - 09 Dec 2006 22:10 GMT
You actually want the Key property of the PublicKey property on the
X509Certificate2 class.

Signature

Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--

> Hi,
>
[quoted text clipped - 21 lines]
>>>
>>> Thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.