Code example for KeyStore

Methods: getCertificate

		params.setRevocationEnabled(false); // to avoid exception on empty CRL 
		// Validate certificate path 
		CertPathValidator validator = CertPathValidator.getInstance("PKIX"); 
		CertPathValidatorResult result = validator.validate(certPath, params); 
		X509Certificate senderCert=(X509Certificate) store.getCertificate(signerCert);
		return senderCert;
	protected JSONObject rebuildJSON(JSONObject oldOne) throws JSONException{
	   JSONObject newOne=new JSONObject();
	   Iterator keys=oldOne.keys();
	   String index=null;
		   newOne.putOpt(index, oldOne.opt(index));
	   return (newOne.length()>0)? newOne:null;
Stop searching for code, let great code find you!  Add Codota to your java IDE