IKeys.FromXmlString returns access denied - WeOnlyDo Discussion board

IKeys.FromXmlString returns access denied (General questions)

by bdowns, Tuesday, August 24, 2010, 22:46 (5203 days ago)

I am getting access denied calling IKeys.FromXmlString(str). My intent is to extract the private key.

i.e.
pKeys.CreateInstance (CLSID_Keys, NULL);

BSTR sXml = L ... RSAKeyValue ... ;

hr = pKeys.FromXmlString(sXml);
// hr is access denied

BSTR privkey = pKeys.PrivateKey(RSAkey);

Re: IKeys.FromXmlString returns access denied

by wodDamir, Tuesday, August 24, 2010, 23:05 (5203 days ago) @ bdowns

Hi,

I can't tell. This is a VC project? Can you perhaps zip and send it to techsupport@weonlydo.com?

Regards,
Damba

Re: IKeys.FromXmlString returns access denied

by bdowns, Wednesday, August 25, 2010, 00:06 (5203 days ago) @ wodDamir

I resolved the FromXmlString issue by copying my string into a new CComBSTR variable. It must not have liked my wchar_t*.

Now I'm not able to get the private key out:
BSTR privkey;
hr = pKeys->get_PrivateKey(RSAkey, &privkey);

privkey appears to have a length of 625, but a printf() prints nothing.

Re: IKeys.FromXmlString returns access denied

by bdowns, Wednesday, August 25, 2010, 20:52 (5202 days ago) @ bdowns

After talking with Tech Support, pKeys.get_PrivateKey() returns a BSTR, but in proprietary format.

I decided to use pKeys.Save() instead. This saves the private key in pem format. There is currently no mechanism to get the private key in pem format as a string from IKeys.

Re: IKeys.FromXmlString returns access denied

by janet986w, Saturday, September 18, 2010, 03:58 (5179 days ago) @ bdowns

After talking with Tech Support, pKeys.get_PrivateKey() returns a BSTR, but in proprietary format.

I decided to use pKeys.Save() instead. This saves the private key in pem format. There is currently no mechanism to get the private key in pem format as a string from IKeys.

Hi !
I've just visited this forum. Happy to get acquainted with you. Thanks.