private OCSPReq createRequest ( SFPair < Certificate , Certificate > pairIssuerSubject ) { Certificate issuer = pairIssuerSubject . left ; Certificate subject = pairIssuerSubject . right ; OCSPReqBuilder gen = new OCSPReqBuilder ( ) ; try { DigestCalculator digest = new SHA1DigestCalculator ( ) ; X509CertificateHolder certHolder = new X509CertificateHolder ( issuer . getEncoded ( ) ) ; CertificateID certId = new CertificateID ( digest , certHolder , subject . getSerialNumber ( ) . getValue ( ) ) ; gen . addRequest ( certId ) ; return gen . build ( ) ; } catch ( OCSPException | IOException ex ) { throw new RuntimeException ( "Failed to build a OCSPReq." ) ; } }
Creates a OCSP Request