public final KeyStore retrieveKeyStore ( InputStream input , char [ ] password ) throws IOException { logger . entry ( ) ; try { KeyStore keyStore = KeyStore . getInstance ( KEY_STORE_FORMAT ) ; keyStore . load ( input , password ) ; logger . exit ( ) ; return keyStore ; } catch ( KeyStoreException | NoSuchAlgorithmException | CertificateException e ) { RuntimeException exception = new RuntimeException ( "An unexpected exception occurred while attempting to retrieve a keystore." , e ) ; logger . error ( exception . toString ( ) ) ; throw exception ; } }
This method retrieves a PKCS12 format key store from an input stream .