use of org.bouncycastle.asn1.esf.OcspResponsesID in project signer by demoiselle.
the class RevocationRefs method makeOcspResponsesID.
/**
* make OcspResponsesID from BasicOCSPResp
*
* @param ocspResp
* @return OcspResponsesID
* @throws NoSuchAlgorithmException
* @throws OCSPException
* @throws IOException
*/
@SuppressWarnings("unused")
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;
}
Aggregations