< prev index next >

src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11DHKeyFactory.java

Print this page

        

*** 182,192 **** Session session = null; try { session = token.getObjSession(); long keyID = token.p11.C_CreateObject(session.id(), attributes); return P11Key.publicKey ! (session, keyID, "DH", p.bitLength(), attributes); } finally { token.releaseSession(session); } } --- 182,192 ---- Session session = null; try { session = token.getObjSession(); long keyID = token.p11.C_CreateObject(session.id(), attributes); return P11Key.publicKey ! (session, keyID, "DH", p.bitLength(), attributes, true); } finally { token.releaseSession(session); } }
*** 204,214 **** Session session = null; try { session = token.getObjSession(); long keyID = token.p11.C_CreateObject(session.id(), attributes); return P11Key.privateKey ! (session, keyID, "DH", p.bitLength(), attributes); } finally { token.releaseSession(session); } } --- 204,214 ---- Session session = null; try { session = token.getObjSession(); long keyID = token.p11.C_CreateObject(session.id(), attributes); return P11Key.privateKey ! (session, keyID, "DH", p.bitLength(), attributes, true); } finally { token.releaseSession(session); } }
*** 219,229 **** --- 219,234 ---- CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] { new CK_ATTRIBUTE(CKA_VALUE), new CK_ATTRIBUTE(CKA_PRIME), new CK_ATTRIBUTE(CKA_BASE), }; + key.incNativeKeyRef(); + try { token.p11.C_GetAttributeValue(session[0].id(), key.keyID, attributes); + } finally { + key.decNativeKeyRef(); + } KeySpec spec = new DHPublicKeySpec( attributes[0].getBigInteger(), attributes[1].getBigInteger(), attributes[2].getBigInteger() );
*** 241,251 **** --- 246,261 ---- CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] { new CK_ATTRIBUTE(CKA_VALUE), new CK_ATTRIBUTE(CKA_PRIME), new CK_ATTRIBUTE(CKA_BASE), }; + key.incNativeKeyRef(); + try { token.p11.C_GetAttributeValue(session[0].id(), key.keyID, attributes); + } finally { + key.decNativeKeyRef(); + } KeySpec spec = new DHPrivateKeySpec( attributes[0].getBigInteger(), attributes[1].getBigInteger(), attributes[2].getBigInteger() );
< prev index next >