Java 类org.bouncycastle.asn1.ocsp.OCSPResponseStatus 实例源码

项目:ipack    文件:CMSUtils.java   
static Collection getOthersFromStore(ASN1ObjectIdentifier otherRevocationInfoFormat, Store otherRevocationInfos)
{
    List others = new ArrayList();

    for (Iterator it = otherRevocationInfos.getMatches(null).iterator(); it.hasNext();)
    {
        ASN1Encodable info = (ASN1Encodable)it.next();

        if (CMSObjectIdentifiers.id_ri_ocsp_response.equals(otherRevocationInfoFormat))
        {
            OCSPResponse resp = OCSPResponse.getInstance(info);

            if (resp.getResponseStatus().getValue().intValue() != OCSPResponseStatus.SUCCESSFUL)
            {
                throw new IllegalArgumentException("cannot add unsuccessful OCSP response to CMS SignedData");
            }
        }

        others.add(new DERTaggedObject(false, 1, new OtherRevocationInfoFormat(otherRevocationInfoFormat, info)));
    }

    return others;
}
项目:irma_future_id    文件:CMSUtils.java   
static Collection getOthersFromStore(ASN1ObjectIdentifier otherRevocationInfoFormat, Store otherRevocationInfos)
{
    List others = new ArrayList();

    for (Iterator it = otherRevocationInfos.getMatches(null).iterator(); it.hasNext();)
    {
        ASN1Encodable info = (ASN1Encodable)it.next();

        if (CMSObjectIdentifiers.id_ri_ocsp_response.equals(otherRevocationInfoFormat))
        {
            OCSPResponse resp = OCSPResponse.getInstance(info);

            if (resp.getResponseStatus().getValue().intValue() != OCSPResponseStatus.SUCCESSFUL)
            {
                throw new IllegalArgumentException("cannot add unsuccessful OCSP response to CMS SignedData");
            }
        }

        others.add(new DERTaggedObject(false, 1, new OtherRevocationInfoFormat(otherRevocationInfoFormat, info)));
    }

    return others;
}
项目:irma_future_id    文件:CMSUtils.java   
static Collection getOthersFromStore(ASN1ObjectIdentifier otherRevocationInfoFormat, Store otherRevocationInfos)
{
    List others = new ArrayList();

    for (Iterator it = otherRevocationInfos.getMatches(null).iterator(); it.hasNext();)
    {
        ASN1Encodable info = (ASN1Encodable)it.next();

        if (CMSObjectIdentifiers.id_ri_ocsp_response.equals(otherRevocationInfoFormat))
        {
            OCSPResponse resp = OCSPResponse.getInstance(info);

            if (resp.getResponseStatus().getValue().intValue() != OCSPResponseStatus.SUCCESSFUL)
            {
                throw new IllegalArgumentException("cannot add unsuccessful OCSP response to CMS SignedData");
            }
        }

        others.add(new DERTaggedObject(false, 1, new OtherRevocationInfoFormat(otherRevocationInfoFormat, info)));
    }

    return others;
}
项目:irma_future_id    文件:CMSUtils.java   
static Collection getOthersFromStore(ASN1ObjectIdentifier otherRevocationInfoFormat, Store otherRevocationInfos)
{
    List others = new ArrayList();

    for (Iterator it = otherRevocationInfos.getMatches(null).iterator(); it.hasNext();)
    {
        ASN1Encodable info = (ASN1Encodable)it.next();

        if (CMSObjectIdentifiers.id_ri_ocsp_response.equals(otherRevocationInfoFormat))
        {
            OCSPResponse resp = OCSPResponse.getInstance(info);

            if (resp.getResponseStatus().getValue().intValue() != OCSPResponseStatus.SUCCESSFUL)
            {
                throw new IllegalArgumentException("cannot add unsuccessful OCSP response to CMS SignedData");
            }
        }

        others.add(new DERTaggedObject(false, 1, new OtherRevocationInfoFormat(otherRevocationInfoFormat, info)));
    }

    return others;
}
项目:bc-java    文件:CMSUtils.java   
static Collection getOthersFromStore(ASN1ObjectIdentifier otherRevocationInfoFormat, Store otherRevocationInfos)
{
    List others = new ArrayList();

    for (Iterator it = otherRevocationInfos.getMatches(null).iterator(); it.hasNext();)
    {
        ASN1Encodable info = (ASN1Encodable)it.next();

        if (CMSObjectIdentifiers.id_ri_ocsp_response.equals(otherRevocationInfoFormat))
        {
            OCSPResponse resp = OCSPResponse.getInstance(info);

            if (resp.getResponseStatus().getValue().intValue() != OCSPResponseStatus.SUCCESSFUL)
            {
                throw new IllegalArgumentException("cannot add unsuccessful OCSP response to CMS SignedData");
            }
        }

        others.add(new DERTaggedObject(false, 1, new OtherRevocationInfoFormat(otherRevocationInfoFormat, info)));
    }

    return others;
}
项目:bc-java    文件:CMSUtils.java   
static Collection getOthersFromStore(ASN1ObjectIdentifier otherRevocationInfoFormat, Store otherRevocationInfos)
{
    List others = new ArrayList();

    for (Iterator it = otherRevocationInfos.getMatches(null).iterator(); it.hasNext();)
    {
        ASN1Encodable info = (ASN1Encodable)it.next();

        if (CMSObjectIdentifiers.id_ri_ocsp_response.equals(otherRevocationInfoFormat))
        {
            OCSPResponse resp = OCSPResponse.getInstance(info);

            if (resp.getResponseStatus().getValue().intValue() != OCSPResponseStatus.SUCCESSFUL)
            {
                throw new IllegalArgumentException("cannot add unsuccessful OCSP response to CMS SignedData");
            }
        }

        others.add(new DERTaggedObject(false, 1, new OtherRevocationInfoFormat(otherRevocationInfoFormat, info)));
    }

    return others;
}
项目:bc-java    文件:CMSUtils.java   
static Collection getOthersFromStore(ASN1ObjectIdentifier otherRevocationInfoFormat, Store otherRevocationInfos)
{
    List others = new ArrayList();

    for (Iterator it = otherRevocationInfos.getMatches(null).iterator(); it.hasNext();)
    {
        ASN1Encodable info = (ASN1Encodable)it.next();

        if (CMSObjectIdentifiers.id_ri_ocsp_response.equals(otherRevocationInfoFormat))
        {
            OCSPResponse resp = OCSPResponse.getInstance(info);

            if (resp.getResponseStatus().getValue().intValue() != OCSPResponseStatus.SUCCESSFUL)
            {
                throw new IllegalArgumentException("cannot add unsuccessful OCSP response to CMS SignedData");
            }
        }

        others.add(new DERTaggedObject(false, 1, new OtherRevocationInfoFormat(otherRevocationInfoFormat, info)));
    }

    return others;
}
项目:gwt-crypto    文件:OCSPRespBuilder.java   
public OCSPResp build(
    int status,
    Object response)
    throws OCSPException
{
    if (response == null)
    {
        return new OCSPResp(new OCSPResponse(new OCSPResponseStatus(status), null));
    }

    if (response instanceof BasicOCSPResp)
    {
        BasicOCSPResp r = (BasicOCSPResp)response;
        ASN1OctetString octs;

        try
        {
            octs = new DEROctetString(r.getEncoded());
        }
        catch (IOException e)
        {
            throw new OCSPException("can't encode object.", e);
        }

        ResponseBytes rb = new ResponseBytes(
            OCSPObjectIdentifiers.id_pkix_ocsp_basic, octs);

        return new OCSPResp(new OCSPResponse(
            new OCSPResponseStatus(status), rb));
    }

    throw new OCSPException("unknown response object");
}
项目:gwt-crypto    文件:CMSUtils.java   
private static void validateInfoFormat(OtherRevocationInfoFormat infoFormat)
{
    if (CMSObjectIdentifiers.id_ri_ocsp_response.equals(infoFormat.getInfoFormat()))
    {
        OCSPResponse resp = OCSPResponse.getInstance(infoFormat.getInfo());

        if (resp.getResponseStatus().getValue().intValue() != OCSPResponseStatus.SUCCESSFUL)
        {
            throw new IllegalArgumentException("cannot add unsuccessful OCSP response to CMS SignedData");
        }
    }
}
项目:Aki-SSL    文件:OCSPRespBuilder.java   
public OCSPResp build(
    int status,
    Object response)
    throws OCSPException
{
    if (response == null)
    {
        return new OCSPResp(new OCSPResponse(new OCSPResponseStatus(status), null));
    }

    if (response instanceof BasicOCSPResp)
    {
        BasicOCSPResp r = (BasicOCSPResp)response;
        ASN1OctetString octs;

        try
        {
            octs = new DEROctetString(r.getEncoded());
        }
        catch (IOException e)
        {
            throw new OCSPException("can't encode object.", e);
        }

        ResponseBytes rb = new ResponseBytes(
            OCSPObjectIdentifiers.id_pkix_ocsp_basic, octs);

        return new OCSPResp(new OCSPResponse(
            new OCSPResponseStatus(status), rb));
    }

    throw new OCSPException("unknown response object");
}
项目:Aki-SSL    文件:CMSUtils.java   
private static void validateInfoFormat(OtherRevocationInfoFormat infoFormat)
{
    if (CMSObjectIdentifiers.id_ri_ocsp_response.equals(infoFormat.getInfoFormat()))
    {
        OCSPResponse resp = OCSPResponse.getInstance(infoFormat.getInfo());

        if (resp.getResponseStatus().getValue().intValue() != OCSPResponseStatus.SUCCESSFUL)
        {
            throw new IllegalArgumentException("cannot add unsuccessful OCSP response to CMS SignedData");
        }
    }
}
项目:dss    文件:DSSRevocationUtils.java   
/**
 * Convert a BasicOCSPResp in OCSPResp (connection status is set to
 * SUCCESSFUL).
 *
 * @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;
}
项目:CryptMeme    文件:OCSPRespGenerator.java   
public OCSPResp generate(
    int     status,
    Object  response)
    throws OCSPException
{
  if (response == null)
  {
          return new OCSPResp(new OCSPResponse(new OCSPResponseStatus(status),null));
  }
    if (response instanceof BasicOCSPResp)
    {
        BasicOCSPResp   r = (BasicOCSPResp)response;
        ASN1OctetString octs;

        try
        {
            octs = new DEROctetString(r.getEncoded());
        }
        catch (IOException e)
        {
            throw new OCSPException("can't encode object.", e);
        }

        ResponseBytes   rb = new ResponseBytes(
                OCSPObjectIdentifiers.id_pkix_ocsp_basic, octs);

        return new OCSPResp(new OCSPResponse(
                                new OCSPResponseStatus(status), rb));
    }

    throw new OCSPException("unknown response object");
}
项目:irma_future_id    文件:OCSPRespBuilder.java   
public OCSPResp build(
    int status,
    Object response)
    throws OCSPException
{
    if (response == null)
    {
        return new OCSPResp(new OCSPResponse(new OCSPResponseStatus(status), null));
    }

    if (response instanceof BasicOCSPResp)
    {
        BasicOCSPResp r = (BasicOCSPResp)response;
        ASN1OctetString octs;

        try
        {
            octs = new DEROctetString(r.getEncoded());
        }
        catch (IOException e)
        {
            throw new OCSPException("can't encode object.", e);
        }

        ResponseBytes rb = new ResponseBytes(
            OCSPObjectIdentifiers.id_pkix_ocsp_basic, octs);

        return new OCSPResp(new OCSPResponse(
            new OCSPResponseStatus(status), rb));
    }

    throw new OCSPException("unknown response object");
}
项目:irma_future_id    文件:OCSPRespGenerator.java   
public OCSPResp generate(
    int     status,
    Object  response)
    throws OCSPException
{
  if (response == null)
  {
          return new OCSPResp(new OCSPResponse(new OCSPResponseStatus(status),null));
  }
    if (response instanceof BasicOCSPResp)
    {
        BasicOCSPResp   r = (BasicOCSPResp)response;
        ASN1OctetString octs;

        try
        {
            octs = new DEROctetString(r.getEncoded());
        }
        catch (IOException e)
        {
            throw new OCSPException("can't encode object.", e);
        }

        ResponseBytes   rb = new ResponseBytes(
                OCSPObjectIdentifiers.id_pkix_ocsp_basic, octs);

        return new OCSPResp(new OCSPResponse(
                                new OCSPResponseStatus(status), rb));
    }

    throw new OCSPException("unknown response object");
}
项目:bc-java    文件:OCSPRespBuilder.java   
public OCSPResp build(
    int status,
    Object response)
    throws OCSPException
{
    if (response == null)
    {
        return new OCSPResp(new OCSPResponse(new OCSPResponseStatus(status), null));
    }

    if (response instanceof BasicOCSPResp)
    {
        BasicOCSPResp r = (BasicOCSPResp)response;
        ASN1OctetString octs;

        try
        {
            octs = new DEROctetString(r.getEncoded());
        }
        catch (IOException e)
        {
            throw new OCSPException("can't encode object.", e);
        }

        ResponseBytes rb = new ResponseBytes(
            OCSPObjectIdentifiers.id_pkix_ocsp_basic, octs);

        return new OCSPResp(new OCSPResponse(
            new OCSPResponseStatus(status), rb));
    }

    throw new OCSPException("unknown response object");
}
项目:bc-java    文件:OCSPRespGenerator.java   
public OCSPResp generate(
    int     status,
    Object  response)
    throws OCSPException
{
  if (response == null)
  {
          return new OCSPResp(new OCSPResponse(new OCSPResponseStatus(status),null));
  }
    if (response instanceof BasicOCSPResp)
    {
        BasicOCSPResp   r = (BasicOCSPResp)response;
        ASN1OctetString octs;

        try
        {
            octs = new DEROctetString(r.getEncoded());
        }
        catch (IOException e)
        {
            throw new OCSPException("can't encode object.", e);
        }

        ResponseBytes   rb = new ResponseBytes(
                OCSPObjectIdentifiers.id_pkix_ocsp_basic, octs);

        return new OCSPResp(new OCSPResponse(
                                new OCSPResponseStatus(status), rb));
    }

    throw new OCSPException("unknown response object");
}