/** * make OcspResponsesID from BasicOCSPResp * * @param ocspResp * @return OcspResponsesID * @throws NoSuchAlgorithmException * @throws OCSPException * @throws IOException */ private OcspResponsesID makeOcspResponsesID(BasicOCSPResp ocspResp) throws NoSuchAlgorithmException, OCSPException, IOException { Digest digest = DigestFactory.getInstance().factoryDefault(); digest.setAlgorithm(DigestAlgorithmEnum.SHA_256); byte[] digestValue = digest.digest(ocspResp.getEncoded()); OtherHash hash = new OtherHash(digestValue); OcspResponsesID ocsprespid = new OcspResponsesID(new OcspIdentifier( ocspResp.getResponderId().toASN1Object(), new DERGeneralizedTime(ocspResp.getProducedAt())), hash); return ocsprespid; }