public static void deleteAlias ( final File keystoreFile , String alias , final String password ) throws NoSuchAlgorithmException , CertificateException , FileNotFoundException , KeyStoreException , IOException { KeyStore keyStore = KeyStoreFactory . newKeyStore ( KeystoreType . JKS . name ( ) , password , keystoreFile ) ; keyStore . deleteEntry ( alias ) ; keyStore . store ( new FileOutputStream ( keystoreFile ) , password . toCharArray ( ) ) ; }
Delete the given alias from the given keystore file .