JDK-8000350 : [macosx] KeyChain KeyStore implementation retrieves only one private key entry
  • Type: Backport
  • Backport of: JDK-7133495
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 7u4
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2012-10-03
  • Updated: 2014-02-05
  • Resolved: 2012-10-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u4Fixed 8 b61Fixed
Description
From http://java.net/jira/browse/MACOSX_PORT-464 --

Even if the user KeyChain contains more than one certificate chain with private key the Keychain-based KeyStore implementation is only able to retrieve one single chain.

Step to reproduce:
(1) import 2 or more certificate with private keys in KeyChain (for instance from PKCS#12 files)
(2) list the entries with keytool:
keytool -list -provider apple.security.AppleProvider -storetype KeychainStore -keystore NONE | grep PrivateKeyEntry
(3) only one entry is printed

Comments
I reproduced with JDK 7 b11 and verified fix with JDK 8 b82: sc22bk06:rajan aurora$ /java/re/jdk/7u4/promoted/all/b11/binaries/macosx-amd64/1.7.0.jdk/Contents/Home/bin/keytool -storetype KeychainStore -keystore NONE -storepass xxxxxx -list | grep -i private KeychainStore Ignored Exception: java.security.cert.CertificateParsingException: java.io.IOException: Duplicate extensions not allowed z, Apr 24, 2013, PrivateKeyEntry, sc22bk06:rajan aurora$ /java/re/jdk/8/promoted/all/b82/binaries/macosx-x86_64/bin/keytool -storetype KeychainStore -keystore NONE -storepass xxxxxx -list | grep -i private KeychainStore Ignored Exception: java.security.cert.CertificateParsingException: java.io.IOException: Duplicate extensions not allowed z, Apr 24, 2013, PrivateKeyEntry, x, Apr 24, 2013, PrivateKeyEntry, y, Apr 24, 2013, PrivateKeyEntry, sc22bk06:rajan aurora$
25-04-2013