Code example for X509Certificate

Methods: checkValidity

		    } else if (certs.size() > 1) {
		      throw new CertificateException("Intermediate certificate is not allowed");
		    if (certs.get(0) instanceof X509Certificate) {
		      X509Certificate cert = (X509Certificate)certs.get(0);
		      return cert;
		    } else { 
		      throw new CertificateException("Certificate is not X509Certificate");
	  public static KeyStore loadKeyStore(Context context) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, FileNotFoundException, IOException, NoSuchProviderException{
			 * Original implementation. 
				I refer the following sites about the default keystore. 
Contextual code suggestions in your IDE  Get Codota for Java