public static KeyStore create(KeyStoreType keyStoreType) throws CryptoException, IOException {
  if (!keyStoreType.isFileBased()) {
    throw new CryptoException(MessageFormat.format(res.getString("NoCreateKeyStoreNotFile.exception.message"),keyStoreType.jce()));
  }
  KeyStore keyStore=getKeyStoreInstance(keyStoreType);
  try {
    keyStore.load(null,null);
  }
 catch (  CertificateException ex) {
    throw new CryptoException(MessageFormat.format(res.getString("NoLoadKeyStoreType.exception.message"),keyStoreType),ex);
  }
catch (  NoSuchAlgorithmException ex) {
    throw new CryptoException(MessageFormat.format(res.getString("NoLoadKeyStoreType.exception.message"),keyStoreType),ex);
  }
  return keyStore;
}

public static KeyStore create ( KeyStoreType keyStoreType ) throws CryptoException , IOException { if ( ! keyStoreType . isFileBased ( ) ) { throw new CryptoException ( MessageFormat . format ( res . getString ( "NoCreateKeyStoreNotFile.exception.message" ) , keyStoreType . jce ( ) ) ) ; } KeyStore keyStore = getKeyStoreInstance ( keyStoreType ) ; try { keyStore . load ( null , null ) ; } catch ( CertificateException ex ) { throw new CryptoException ( MessageFormat . format ( res . getString ( "NoLoadKeyStoreType.exception.message" ) , keyStoreType ) , ex ) ; } catch ( NoSuchAlgorithmException ex ) { throw new CryptoException ( MessageFormat . format ( res . getString ( "NoLoadKeyStoreType.exception.message" ) , keyStoreType ) , ex ) ; } return keyStore ; }
create a new , empty keystore .
