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

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

Introduction

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

Prototype

public ResponseBytes(ASN1ObjectIdentifier responseType, ASN1OctetString response) 

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/*from w w w .jav  a 2s. co 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).
 * //w  w  w  .  ja  v  a 2  s . c  o  m
 * @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  .  ja v  a  2s  . 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;
}