@@ -370,19 +370,22 @@ private void fetchCrlData(CertSignatureInformation certInfo) throws IOException
370370 private void addOcspData (CertSignatureInformation certInfo ) throws IOException , OCSPException ,
371371 CertificateProccessingException , RevokedCertificateException , URISyntaxException
372372 {
373- if (ocspChecked .contains (certInfo .getCertificate ()))
373+ X509Certificate certificate = certInfo .getCertificate ();
374+ X509Certificate issuerCertificate = certInfo .getIssuerCertificate ();
375+ String ocspURL = certInfo .getOcspUrl ();
376+ if (ocspChecked .contains (certificate ))
374377 {
375378 // This certificate has been OCSP-checked before
376379 return ;
377380 }
378381 OcspHelper ocspHelper = new OcspHelper (
379- certInfo . getCertificate () ,
382+ certificate ,
380383 signDate .getTime (),
381- certInfo . getIssuerCertificate () ,
384+ issuerCertificate ,
382385 new HashSet <>(certInformationHelper .getCertificateSet ()),
383- certInfo . getOcspUrl () );
386+ ocspURL );
384387 OCSPResp ocspResp = ocspHelper .getResponseOcsp ();
385- ocspChecked .add (certInfo . getCertificate () );
388+ ocspChecked .add (certificate );
386389 BasicOCSPResp basicResponse = (BasicOCSPResp ) ocspResp .getResponseObject ();
387390 X509Certificate ocspResponderCertificate = ocspHelper .getOcspResponderCertificate ();
388391 certInformationHelper .addAllCertsFromHolders (basicResponse .getCerts ());
@@ -424,7 +427,7 @@ private void addOcspData(CertSignatureInformation certInfo) throws IOException,
424427 {
425428 correspondingOCSPs .add (ocspStream );
426429 }
427- foundRevocationInformation .add (certInfo . getCertificate () );
430+ foundRevocationInformation .add (certificate );
428431 }
429432
430433 /**
0 commit comments