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
 
Commented lines fix the problem?  
by Attila Bak [bak at firemail dot de]
posted on 2004/06/07

Hi,

I have commented the following lines back and now the sample works...?
Can you help me what this line does?
Why is the "AssymetricSample" working now?
Many thanks

attila

if (SspiProvider.CertSetCertificateContextProperty(this.Handle, SecurityConstants.CERT_KEY_PROV_INFO_PROP_ID, 0, ref kpi) == 0)
throw new CertificateException("Could not associate the private key with the certificate.");

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

Which certificate are you using? Are you using the 'client.cer' certificate that ships with the library, or are you using one of your own certificates?

If you're using one of your own certificates, it's possible that the certificate is already associated with a private key (and hence the error in the AssociateWithPrivateKey method).

The line you removed is a very important part of the AssociateWithPrivateKey method. Without it, the method doesn't associate the private key with the certificate (which is the entire point of that 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.