public static boolean verify(X509Certificate X509certificateRoot,
Collection collectionX509CertificateChain,X509CRL X509crl,String stringTarget) {
//获取证书链长度
int nSize=collectionX509CertificateChain.size();
//将证书链转化为数组
X509Certificate[] arX509certificate=new X509Certificate[nSize];
collectionX509CertificateChain.toArray(arX509certificate);
//声明list,存储证书链中证书主体信息
ArrayList list=new ArrayList();
//沿证书链自上而下,验证证书的所有者是下一个证书的颁布者
Principal principalLast=null;
for(int i=0;i
X509Certificate x509Certificate=arX509certificate[i];
//获取发布者标识
Principal principalIssuer=x509Certificate.getIssuerDN();
//获取证书的主体标识
Principal principalSubject=x509Certificate.getSubjectDN();
//保存证书的序列号
list.add(x509Certificate.getSerialNumber());
if(principalLast!=n