Can't get private key objects

6/28/2016 3:40:45 PM
Gravatar
Total Posts 4

Can't get private key objects

Hello,

 

Our private keys are not exportable we are aware of that, even if they are, we should be able to get a reference to the private key objects right? 

We use the following code blocks but private key list is empty. What could be the reason for that? 

<span data-scayt_word="ArrayList" data-scaytid="5">ArrayList<<span data-scayt_word="CryptokiAttribute" data-scaytid="16">CryptokiAttribute> template = new <span data-scayt_word="ArrayList" data-scaytid="15">ArrayList<<span data-scayt_word="CryptokiAttribute" data-scaytid="17">CryptokiAttribute>();
template.add(new <span data-scayt_word="CryptokiAttribute" data-scaytid="7">CryptokiAttribute(CryptokiAttribute.CKA_CLASS, CryptokiObject.CKO_PRIVATE_KEY));           

List<<span data-scayt_word="CryptokiObject" data-scaytid="26" style="background-color: rgb(195, 206, 213);">CryptokiObject> objects = session.getObjects().find(template, 10);

Are the flags passed while opening a session is important?

Session session = token.openSession(SessionInfo.CKF_SERIAL_SESSION | SessionInfo.CKF_RW_SESSION, null, null); 

We login with user passcode

<span data-scayt_word="int" data-scaytid="52">int <span data-scayt_word="nRes" data-scaytid="53">nRes = session.login(Session.CKU_USER, "<span data-scayt_word="xxxxxx" data-scaytid="58">xxxxxx");

Everything goes well up to this point and we could get public keys and certificates but not the private keys

6/30/2016 10:56:16 AM
Gravatar
Total Posts 30

Re: Can't get private key objects

Hi <span data-scayt_word="Mehmet" data-scaytid="3">Mehmet,

Are you working with 64bit OS and JRE?

We recently found an issue with <span data-scayt_word="64bit" data-scaytid="1">64bit <span data-scayt_word="JRE" data-scaytid="2">JRE. We are going to release a new version that fix such an issue. maybe this issue is <span data-scayt_word="releated" data-scaytid="24">releated to your problem

7/1/2016 4:11:49 PM
Gravatar
Total Posts 4

Re: Can't get private key objects

It looks like there is an issue with our <span data-scayt_word="HSM" data-scaytid="1">HSM setup. I will let you know if the problem continues after the <span data-scayt_word="HSM" data-scaytid="11">HSM is set up <span data-scayt_word="propertly" data-scaytid="21">propertly. 

 

Thanks, 

7/14/2016 5:52:49 PM
Gravatar
Total Posts 4

Re: Can't get private key objects

Hello Admin, 

 

Our <span data-scayt_word="HSM" data-scaytid="1">HSM setup is ok now. We implemented a PDF Signer and it works fine on windows.

 

When it comes to <span data-scayt_word="linux" data-scaytid="29">linux, it is unable to list available slots successfully, normally the <span data-scayt_word="hsm" data-scaytid="38">hsm has 4 slots, the same code running on windows is able to fetch them. In <span data-scayt_word="linux" data-scaytid="50">linux <span data-scayt_word="getSlots" data-scaytid="61">getSlots returns one item which we are not sure came from. 

 

We use 64 bit OS & <span data-scayt_word="JRE" data-scaytid="86">JRE, is the issue you mentioned previously is related to this one? Also when would the new version be available? 

 

Thanks, 

7/14/2016 5:54:42 PM
Gravatar
Total Posts 4

Re: Can't get private key objects

Addition:

We are sure <span data-scayt_word="HSM" data-scaytid="1">HSM is set up properly on <span data-scayt_word="linux" data-scaytid="6">linux. When we check setup via the tools provided by <span data-scayt_word="hsm" data-scaytid="19">hsm provider, we can see 4 slots and tests run  passes.