private static KeyStore createStore(KeyStoreType storeType) { try { return KeyStore.getInstance(storeType.typeName()); } catch (KeyStoreException ex) { throw new IllegalArgumentException("KeyStore of type '" + storeType + "' cannot be instantiated.", ex); } }