Hi
I'm trying to retrieve an RSA Private Key from a ncipher net hsm 2000, but for some I can't find the keys. I know there is a key on the particular slot I'm connected to - but I can't retrieve it. The code below is based on the sample code from the wiki. Any ideas what I might be doing wrong? Is there a way to list all "objects" stored in that slot (e.g. to see whats really there)?
Best regards, Mikael
CryptokiCollection template = new CryptokiCollection(); template = new CryptokiCollection(); template.Add(new ObjectAttribute(ObjectAttribute.CKA_CLASS, CryptokiObject.CKO_PRIVATE_KEY)); template.Add(new ObjectAttribute(ObjectAttribute.CKA_KEY_TYPE, Key.CKK_RSA)); //template.Add(new ObjectAttribute(ObjectAttribute.CKA_LABEL, "SigningKey_SYD_TEST_HSM_20120314_111500"));
CryptokiCollection objects = session.Objects.Find(template, 1); //generates 0 results
Hi Ugo
Thanks for a fast reply :)
Yes, the login was successfull (returned 0): int nRes = session.Login(Session.CKU_USER, pin);
Is the problem perhaps that I logged in as user instead of... well, the other alternatives ;)
Regards, Mikael