Code example for KeyStore

Methods: getCertificate, getKey

0
		} 
	} 
	 
	public static X509CertificateEx getInternalCert(String alias) throws Exception
	{ 
		X509Certificate cert = (X509Certificate)keyStore.getCertificate(alias);
		 
		return X509CertificateEx.fromX509Certificate(cert, (PrivateKey)keyStore.getKey("user1", pkPassword.toCharArray()));
	} 
	 
	 
	public static X509Certificate getExternalCert(String alias) throws Exception
	{ 
		return  (X509Certificate)keyStore.getCertificate(alias);		
	}	 
	 
	public static X509Certificate getInternalCACert(String alias) throws Exception
	{ 
		return  (X509Certificate)keyStore.getCertificate(alias);		
	}