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
 
Could not acquire private key  
by pit
posted on 2004/04/03

hi! :)
here's a sample code i have:
string cerfile="cert.cer";
Certificate cert = Certificate.CreateFromCerFile(cerfile);
string pvkfile="cert.pvk";
cert.AssociateWithPrivateKey(pvkfile,"pass",false);
RSA private_key = cert.PrivateKey;
the last line causes an exception: "Could not acquire private key". the files are ok, any idea what could be the problem?
thx.

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2004/05/13

There can be several problems, but mostly they are related to running the security library under user accounts that lack the necessary privileges.

Could you tell us something more about your situation? Which OS, framework, etc. are you using? Are you running your code in an ASP.NET web service?

by John
posted on 2004/07/28

I'm having exactly the same issue even trying to run the example application. The stack trace is as follows:

Unhandled Exception: Org.Mentalis.Security.Certificates.CertificateException: Co
uld not acquire private key.
at Org.Mentalis.Security.Certificates.Certificate.get_PrivateKey()
at AsymmetricCryptography.Main(String[] args)

I'm running this on Windows XP with v1.0.3705 of the .NET Framework. I've tried applying (and then removing) the most liberal permissions, but with no luck. If anyone does come up with an answer, I'd love to know 'cus it's got me stumped.

by Norman [norman_lm_fung at hotmail dot com]
posted on 2004/09/19

I'm having the same problem, running C# sample "AsymmetricCryptography" on Windows 2003 using Administrator account...

This is the line where it failed:

cert.AssociateWithPrivateKey(@"client.pvk", "test", true);

Help!

 

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