private KeyStore createKeyStore ( String fileName , String password ) { File file = new File ( fileName ) ; KeyStore keyStore = null ; try { keyStore = KeyStore . getInstance ( "JCEKS" ) ; if ( file . exists ( ) ) { keyStore . load ( new FileInputStream ( file ) , password . toCharArray ( ) ) ; } else { keyStore . load ( null , null ) ; keyStore . store ( new FileOutputStream ( fileName ) , password . toCharArray ( ) ) ; } } catch ( CertificateException | IOException | KeyStoreException | NoSuchAlgorithmException e ) { logger . error ( "Unable to create key store" , e ) ; } return keyStore ; }
Creates a new keystore for the izou aes key