IKeys.FromXmlString returns access denied (General questions)

by bdowns @, (5373 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);

locked

Re: IKeys.FromXmlString returns access denied

by wodDamir @, (5373 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

locked

Re: IKeys.FromXmlString returns access denied

by bdowns @, (5373 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.

locked

Re: IKeys.FromXmlString returns access denied

by bdowns @, (5372 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.

locked

Re: IKeys.FromXmlString returns access denied

by janet986w @, (5349 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.

locked