public signingcertificatev2(esscertidv2[] certs) {
   asn1encodablevector v = new asn1encodablevector();
   for (int i = 0; i < certs.length; i++) {
     v.add(certs[i]);
   }
   this.certs = new dersequence(v);
 }
示例#2
0
 public pkifreetext(string[] strs) {
   asn1encodablevector v = new asn1encodablevector();
   for (int i = 0; i < strs.length; i++) {
     v.add(new derutf8string(strs[i]));
   }
   strings = new dersequence(v);
 }
示例#3
0
  /**
   * produce an object suitable for an asn1outputstream.
   *
   * <pre>
   * attribute ::= sequence {
   *     attrtype object identifier,
   *     attrvalues set of attributevalue
   * }
   * </pre>
   */
  public asn1primitive toasn1primitive() {
    asn1encodablevector v = new asn1encodablevector();

    v.add(attrtype);
    v.add(attrvalues);

    return new dersequence(v);
  }
  /**
   *
   *
   * <pre>
   * pkipublicationinfo ::= sequence {
   *                  action     integer {
   *                                 dontpublish (0),
   *                                 pleasepublish (1) },
   *                  pubinfos  sequence size (1..max) of singlepubinfo optional }
   * -- pubinfos must not be present if action is "dontpublish"
   * -- (if action is "pleasepublish" and pubinfos is omitted,
   * -- "dontcare" is assumed)
   * </pre>
   *
   * @return a basic asn.1 object representation.
   */
  public asn1primitive toasn1primitive() {
    asn1encodablevector v = new asn1encodablevector();

    v.add(action);
    v.add(pubinfos);

    return new dersequence(v);
  }
示例#5
0
  /**
   *
   *
   * <pre>
   * certreqmsg ::= sequence {
   *                    certreq   certrequest,
   *                    popo       proofofpossession  optional,
   *                    -- content depends upon key type
   *                    reginfo   sequence size(1..max) of attributetypeandvalue optional }
   * </pre>
   *
   * @return a basic asn.1 object representation.
   */
  public asn1primitive toasn1primitive() {
    asn1encodablevector v = new asn1encodablevector();

    v.add(certreq);

    addoptional(v, pop);
    addoptional(v, reginfo);

    return new dersequence(v);
  }
  /**
   * the definition of signingcertificatev2 is
   *
   * <pre>
   * signingcertificatev2 ::=  sequence {
   *      certs        sequence of esscertidv2,
   *      policies     sequence of policyinformation optional
   * }
   * </pre>
   *
   * id-aa-signingcertificatev2 object identifier ::= { iso(1) member-body(2) us(840) rsadsi(113549)
   * pkcs(1) pkcs9(9) smime(16) id-aa(2) 47 }
   */
  public asn1primitive toasn1primitive() {
    asn1encodablevector v = new asn1encodablevector();

    v.add(certs);

    if (policies != null) {
      v.add(policies);
    }

    return new dersequence(v);
  }
示例#7
0
  /**
   * produce an object suitable for an asn1outputstream.
   *
   * <pre>
   * signature       ::=     sequence {
   *     signaturealgorithm      algorithmidentifier,
   *     signature               bit string,
   *     certs               [0] explicit sequence of certificate optional}
   * </pre>
   */
  public asn1primitive toasn1primitive() {
    asn1encodablevector v = new asn1encodablevector();

    v.add(signaturealgorithm);
    v.add(signature);

    if (certs != null) {
      v.add(new dertaggedobject(true, 0, certs));
    }

    return new dersequence(v);
  }
  public signingcertificatev2(esscertidv2[] certs, policyinformation[] policies) {
    asn1encodablevector v = new asn1encodablevector();
    for (int i = 0; i < certs.length; i++) {
      v.add(certs[i]);
    }
    this.certs = new dersequence(v);

    if (policies != null) {
      v = new asn1encodablevector();
      for (int i = 0; i < policies.length; i++) {
        v.add(policies[i]);
      }
      this.policies = new dersequence(v);
    }
  }
  public dvcsrequestinformation build() {
    asn1encodablevector v = new asn1encodablevector();

    if (version != default_version) {
      v.add(new asn1integer(version));
    }
    v.add(service);
    if (nonce != null) {
      v.add(new asn1integer(nonce));
    }
    if (requesttime != null) {
      v.add(requesttime);
    }

    int[] tags =
        new int[] {tag_requester, tag_request_policy, tag_dvcs, tag_data_locations, tag_extensions};
    asn1encodable[] taggedobjects =
        new asn1encodable[] {requester, requestpolicy, dvcs, datalocations, extensions};
    for (int i = 0; i < tags.length; i++) {
      int tag = tags[i];
      asn1encodable taggedobject = taggedobjects[i];
      if (taggedobject != null) {
        v.add(new dertaggedobject(false, tag, taggedobject));
      }
    }

    return dvcsrequestinformation.getinstance(new dersequence(v));
  }
示例#10
0
 private void addoptional(asn1encodablevector v, asn1encodable obj) {
   if (obj != null) {
     v.add(obj);
   }
 }
示例#11
0
 /**
  * produce an object suitable for an asn1outputstream.
  *
  * <p>returns:
  *
  * <p>
  *
  * <pre>
  *     certhash ::= sequence {
  *       hashalgorithm algorithmidentifier,
  *       certificatehash octet string
  *     }
  * </pre>
  *
  * @return a derobject
  */
 public asn1primitive toasn1primitive() {
   asn1encodablevector vec = new asn1encodablevector();
   vec.add(hashalgorithm);
   vec.add(new deroctetstring(certificatehash));
   return new dersequence(vec);
 }