Ejemplo n.º 1
0
 /**
  * @deprecated use method taking Extensions
  * @param responderID
  * @param producedAt
  * @param responses
  * @param responseExtensions
  */
 public ResponseData(
     ResponderID responderID,
     DERGeneralizedTime producedAt,
     ASN1Sequence responses,
     X509Extensions responseExtensions) {
   this(V1, responderID, producedAt, responses, Extensions.getInstance(responseExtensions));
 }
Ejemplo n.º 2
0
  private ResponseData(ASN1Sequence seq) {
    int index = 0;

    if (seq.getObjectAt(0) instanceof ASN1TaggedObject) {
      ASN1TaggedObject o = (ASN1TaggedObject) seq.getObjectAt(0);

      if (o.getTagNo() == 0) {
        this.versionPresent = true;
        this.version = ASN1Integer.getInstance((ASN1TaggedObject) seq.getObjectAt(0), true);
        index++;
      } else {
        this.version = V1;
      }
    } else {
      this.version = V1;
    }

    this.responderID = ResponderID.getInstance(seq.getObjectAt(index++));
    this.producedAt = (DERGeneralizedTime) seq.getObjectAt(index++);
    this.responses = (ASN1Sequence) seq.getObjectAt(index++);

    if (seq.size() > index) {
      this.responseExtensions =
          Extensions.getInstance((ASN1TaggedObject) seq.getObjectAt(index), true);
    }
  }
Ejemplo n.º 3
0
  /**
   * Parse a {@link OCSPStatusRequest} from an {@link InputStream}.
   *
   * @param input the {@link InputStream} to parse from.
   * @return a {@link OCSPStatusRequest} object.
   * @throws IOException
   */
  public static OCSPStatusRequest parse(InputStream input) throws IOException {
    Vector responderIDList = new Vector();
    {
      int length = TlsUtils.readUint16(input);
      if (length > 0) {
        byte[] data = TlsUtils.readFully(length, input);
        ByteArrayInputStream buf = new ByteArrayInputStream(data);
        do {
          byte[] derEncoding = TlsUtils.readOpaque16(buf);
          ResponderID responderID = ResponderID.getInstance(TlsUtils.readDERObject(derEncoding));
          responderIDList.addElement(responderID);
        } while (buf.available() > 0);
      }
    }

    Extensions requestExtensions = null;
    {
      int length = TlsUtils.readUint16(input);
      if (length > 0) {
        byte[] derEncoding = TlsUtils.readFully(length, input);
        requestExtensions = Extensions.getInstance(TlsUtils.readDERObject(derEncoding));
      }
    }

    return new OCSPStatusRequest(responderIDList, requestExtensions);
  }