|
38 | 38 | import javax.crypto.Cipher; |
39 | 39 | import javax.crypto.SecretKeyFactory; |
40 | 40 | import javax.crypto.spec.SecretKeySpec; |
41 | | -import javax.crypto.spec.DHPrivateKeySpec; |
42 | 41 | import javax.crypto.spec.IvParameterSpec; |
43 | 42 |
|
44 | 43 | import sun.security.jca.JCAUtil; |
@@ -194,34 +193,6 @@ static Long importKey(SunPKCS11 sunPKCS11, long hSession, CK_ATTRIBUTE[] attribu |
194 | 193 | attrsMap.put(CKA_NETSCAPE_DB, |
195 | 194 | new CK_ATTRIBUTE(CKA_NETSCAPE_DB, BigInteger.ZERO)); |
196 | 195 | } |
197 | | - } else if (keyType == CKK_DH) { |
198 | | - if (debug != null) { |
199 | | - debug.println("Importing a Diffie-Hellman private key..."); |
200 | | - } |
201 | | - if (DHKF == null) { |
202 | | - DHKFLock.lock(); |
203 | | - try { |
204 | | - if (DHKF == null) { |
205 | | - DHKF = KeyFactory.getInstance( |
206 | | - "DH", P11Util.getSunJceProvider()); |
207 | | - } |
208 | | - } finally { |
209 | | - DHKFLock.unlock(); |
210 | | - } |
211 | | - } |
212 | | - DHPrivateKeySpec spec = new DHPrivateKeySpec |
213 | | - (((v = attrsMap.get(CKA_VALUE).getBigInteger()) != null) |
214 | | - ? v : BigInteger.ZERO, |
215 | | - ((v = attrsMap.get(CKA_PRIME).getBigInteger()) != null) |
216 | | - ? v : BigInteger.ZERO, |
217 | | - ((v = attrsMap.get(CKA_BASE).getBigInteger()) != null) |
218 | | - ? v : BigInteger.ZERO); |
219 | | - keyBytes = DHKF.generatePrivate(spec).getEncoded(); |
220 | | - if (token.config.getNssNetscapeDbWorkaround() && |
221 | | - attrsMap.get(CKA_NETSCAPE_DB) == null) { |
222 | | - attrsMap.put(CKA_NETSCAPE_DB, |
223 | | - new CK_ATTRIBUTE(CKA_NETSCAPE_DB, BigInteger.ZERO)); |
224 | | - } |
225 | 196 | } else { |
226 | 197 | if (debug != null) { |
227 | 198 | debug.println("Unrecognized private key type."); |
|
0 commit comments