Code example for X509Certificate

Methods: checkValidity, getPublicKey, verify

0
	 */ 
	public List<VerificationOK> verify(X509Certificate signCert, X509Certificate issuerCert, Date signDate)
			throws GeneralSecurityException, IOException { 
		// Check if the certificate is valid on the signDate 
		if (signDate != null)
			signCert.checkValidity(signDate);
		// Check if the signature is valid 
		if (issuerCert != null) {
			signCert.verify(issuerCert.getPublicKey());
		} 
		// Also in case, the certificate is self-signed 
		else { 
			signCert.verify(signCert.getPublicKey());
		} 
		List<VerificationOK> result = new ArrayList<VerificationOK>();
		if (verifier != null)
			result.addAll(verifier.verify(signCert, issuerCert, signDate));
		return result;
	} 
}