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
 
CreateFromPfxFile  
by Wayne [Wayne dot Smithers at 5thFinger dot com]
posted on 2003/08/25

I've got a Personal Information Exchange ( .p12 ) certificate.

Using IE to import this file using a password works fine.

Using Certificate.CreateFromPfxFile() fails with 'Unable to import the PFX file!'

Is I use IE to export it to X509 I loose the privatekey.

any ideas ?

ragards
Wayne

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2003/08/25

Hmm, this is a peculiar problem because the Security Library uses the same API functions IE uses. The error you're getting is particularly strange because at that point in the execution the byte array has already been verified to be a valid PFX file and the password has also been verified.

Have you tried importing it with IE and then exporting it back to another file?
When importing the PFX file, make sure to select "Mark this key as exportable".
When exporting the certificate, make sure to select "Yes, export the private key".

by Germen [germen at astri dot org]
posted on 2003/09/03

The error occurs, if the certificates in the certificate path is included in the .p12 certificate. I am it is normal, since every CA signed cert should have the CA's cert comes with it.

Correct me if I am wrong!

Do you have any work around for this problem?

Many Thanks,
Germen

by Germen
posted on 2003/09/04

sorry please ignore the previous post

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

The error has been solved. It had to do with the fact that ASP.NET does not load a user profile.
This problem can be avoided in the recent releases of the library by using the KeysetLocation parameter of the CreateFromPfxFile 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.