News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Security Library Forum
 
retreiving public key from certificate  
by Aryana [s_ghanipour at yahoo dot com]
posted on 2004/06/27

Hi,
I want to extract public key from a X509 DER encoded certificate but i don't know the format of storing public key in the certificate. What i need to know is the order of storing modulus and public exponent and key length in the public key field of a DER encoded certificate.
Any point is appreciated.
Aryana

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2004/06/29

Here's how you can do it with the security library:
- first load the certificate
Certificate c = Certificate.CreateFromCerFile("...");
- then get an RSA instance that represents the public key
RSA pub = c.PublicKey;
- finally, export the public key modulus and exponent
RSAParameters rsap = pub.ExportParameters(false);

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.