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
 
reading a PK in PEM format  
by German [gmarin at microsoft dot com]
posted on 2003/09/11

Hi :

I have a private key in PEM format and I want to use it to sign an string. I need to read RSA parameters in order to save this PrivateKey to XML . Could I do that with Mentalis Security Library?

Thanks a lot

German

<RSASK>-----BEGIN RSA PRIVATE KEY----- MIIBOwIBAAJBANG[REMOVED FOR SECURITY REASONS]63PSXyN7MFAX7TYe25mw== -----END RSA PRIVATE KEY-----</RSASK>
<RSAPUBK>-----BEGIN PUBLIC KEY----- MFowDQYJKoZIhvcNAQEBBQADSQAwRgJBANGuDuim8fEI9yuIlkj+MOyp3mWHifoP 6a4oWLSBKJSrd3MpEsZdczvL0l7t/e0IU5rF+0gRLnU1Mfvtsw1wYWcCAQM= -----END PUBLIC KEY-----</RSAPUBK>

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2003/09/11

At this point, the Security Library has only basic support for PEM files. Only extracting certificates is supported at this point.
However, you can convert your PEM file to a PFX file using tools such as OpenSSL. Once you have the PFX file, you can load it with the Security Library using the Certificate.CreateFromPfxFile method.

If you have OpenSSL, you can use the following command to convert your PEM file to PFX:
openssl pkcs12 -export -in certificate.pem -inkey key.pem -out certificate.pfx -name "My Certificate"

Let me know if you don't have a compiled copy of OpenSSL and I'll send you one.

by german [gmarin at microsoft dot com]
posted on 2003/09/12

"Only extracting certificates is supported at this point.". HOW?

I want to use only .net, so I discarded OpenSSL.

Thanks


by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2003/09/12

You can extract certificates from a PEM file with the Certificate.CreateFromPemFile method.

 

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