KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType()); FileInputStream is = new FileInputStream(it.authenticationMethod.keystore); try { keystore.load(is, am.getKeypwd().getPlainText().toCharArray()); } finally { is.close(); } def KEY_ENCIPHERMENT_USAGE = 2 // https://www.ietf.org/rfc/rfc3280.txt