Example usage for org.bouncycastle.asn1.ocsp OCSPResponse OCSPResponse

List of usage examples for org.bouncycastle.asn1.ocsp OCSPResponse OCSPResponse

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.ocsp OCSPResponse OCSPResponse.

Prototype

public OCSPResponse(OCSPResponseStatus responseStatus, ResponseBytes responseBytes) 

Source Link

Usage

From source file:eu.europa.ec.markt.dss.DSSRevocationUtils.java

License:Open Source License

/**
 * Convert a BasicOCSPResp in OCSPResp (connection status is set to SUCCESSFUL).
 *
 * @param basicOCSPResp/* w ww  .  j  ava 2  s. c  o m*/
 * @return
 */
public static final OCSPResp fromBasicToResp(final byte[] basicOCSPResp) {

    final OCSPResponseStatus responseStatus = new OCSPResponseStatus(OCSPResponseStatus.SUCCESSFUL);
    final DEROctetString derBasicOCSPResp = new DEROctetString(basicOCSPResp);
    final ResponseBytes responseBytes = new ResponseBytes(OCSPObjectIdentifiers.id_pkix_ocsp_basic,
            derBasicOCSPResp);
    final OCSPResponse ocspResponse = new OCSPResponse(responseStatus, responseBytes);
    final OCSPResp ocspResp = new OCSPResp(ocspResponse);
    //!!! todo to be checked: System.out.println("===> RECREATED: " + ocspResp.hashCode());
    return ocspResp;
}

From source file:eu.europa.ec.markt.dss.validation.ocsp.OCSPUtils.java

License:Open Source License

/**
 * Convert a BasicOCSPResp in OCSPResp (connection status is set to SUCCESSFUL).
 * //from  w  ww. ja va 2 s .com
 * @param basicOCSPResp
 * @return
 */
public static final OCSPResp fromBasicToResp(byte[] basicOCSPResp) {
    OCSPResponse response = new OCSPResponse(new OCSPResponseStatus(OCSPResponseStatus.SUCCESSFUL),
            new ResponseBytes(OCSPObjectIdentifiers.id_pkix_ocsp_basic, new DEROctetString(basicOCSPResp)));
    OCSPResp resp = new OCSPResp(response);
    return resp;
}

From source file:eu.europa.esig.dss.DSSRevocationUtils.java

License:Open Source License

/**
 * Convert a BasicOCSPResp in OCSPResp (connection status is set to
 * SUCCESSFUL)./*from   w  w w  .  j a va  2  s.c  o  m*/
 *
 * @param basicOCSPResp
 * @return
 */
public static final OCSPResp fromBasicToResp(final byte[] basicOCSPResp) {
    final OCSPResponseStatus responseStatus = new OCSPResponseStatus(OCSPResponseStatus.SUCCESSFUL);
    final DEROctetString derBasicOCSPResp = new DEROctetString(basicOCSPResp);
    final ResponseBytes responseBytes = new ResponseBytes(OCSPObjectIdentifiers.id_pkix_ocsp_basic,
            derBasicOCSPResp);
    final OCSPResponse ocspResponse = new OCSPResponse(responseStatus, responseBytes);
    final OCSPResp ocspResp = new OCSPResp(ocspResponse);
    // !!! todo to be checked: System.out.println("===> RECREATED: " +
    // ocspResp.hashCode());
    return ocspResp;
}

From source file:org.xipki.ocsp.server.impl.OcspServer.java

License:Open Source License

private static OcspRespWithCacheInfo createUnsuccessfullOCSPResp(final OcspResponseStatus status) {
    OCSPResp resp = new OCSPResp(
            new OCSPResponse(new org.bouncycastle.asn1.ocsp.OCSPResponseStatus(status.getStatus()), null));
    return new OcspRespWithCacheInfo(resp, null);
}

From source file:org.xipki.pki.ocsp.server.impl.OcspServer.java

License:Open Source License

private static OcspRespWithCacheInfo createUnsuccessfulOcspResp(final OcspResponseStatus status) {
    OCSPResp resp = new OCSPResp(
            new OCSPResponse(new org.bouncycastle.asn1.ocsp.OCSPResponseStatus(status.getStatus()), null));
    return new OcspRespWithCacheInfo(resp, null);
}