public static KeyStore getKeyStore ( File keyStoreFile , String keyStorePassword , String tlsStoreType ) throws IOException { KeyStore keyStore = null ; if ( keyStoreFile != null && keyStorePassword != null ) { try ( InputStream inputStream = new FileInputStream ( keyStoreFile ) ) { keyStore = KeyStore . getInstance ( tlsStoreType ) ; keyStore . load ( inputStream , keyStorePassword . toCharArray ( ) ) ; } catch ( CertificateException | NoSuchAlgorithmException | KeyStoreException e ) { throw new IOException ( e ) ; } } return keyStore ; }
Method to create a keystore and return .