Ejemplo n.º 1
0
  public static AttCertIssuer getInstance(Object obj) {
    if (obj instanceof AttCertIssuer) {
      return (AttCertIssuer) obj;
    } else if (obj instanceof V2Form) {
      return new AttCertIssuer(V2Form.getInstance(obj));
    } else if (obj instanceof GeneralNames) {
      return new AttCertIssuer((GeneralNames) obj);
    } else if (obj instanceof ASN1TaggedObject) {
      return new AttCertIssuer(V2Form.getInstance((ASN1TaggedObject) obj, false));
    } else if (obj instanceof ASN1Sequence) {
      return new AttCertIssuer(GeneralNames.getInstance(obj));
    }

    throw new IllegalArgumentException("unknown object in factory: " + obj.getClass());
  }
Ejemplo n.º 2
0
  @DSGenerator(
      tool_name = "Doppelganger",
      tool_version = "2.0",
      generated_on = "2013-12-30 13:00:22.496 -0500",
      hash_original_method = "6A7E42DF8EF9B09B844C872DFCA023C7",
      hash_generated_method = "21B5E94B1503EB3B81CAD22E6A3D29F8")
  public IssuerSerial(ASN1Sequence seq) {
    if (seq.size() != 2 && seq.size() != 3) {
      throw new IllegalArgumentException("Bad sequence size: " + seq.size());
    }

    issuer = GeneralNames.getInstance(seq.getObjectAt(0));
    serial = DERInteger.getInstance(seq.getObjectAt(1));

    if (seq.size() == 3) {
      issuerUID = DERBitString.getInstance(seq.getObjectAt(2));
    }
  }
Ejemplo n.º 3
0
  /**
   * Constructor that builds an instance of <code>RoleSyntax</code> by extracting the encoded
   * elements from the <code>ASN1Sequence</code> object supplied.
   *
   * @param seq an instance of <code>ASN1Sequence</code> that holds the encoded elements used to
   *     build this <code>RoleSyntax</code>.
   */
  private RoleSyntax(ASN1Sequence seq) {
    if (seq.size() < 1 || seq.size() > 2) {
      throw new IllegalArgumentException("Bad sequence size: " + seq.size());
    }

    for (int i = 0; i != seq.size(); i++) {
      ASN1TaggedObject taggedObject = ASN1TaggedObject.getInstance(seq.getObjectAt(i));
      switch (taggedObject.getTagNo()) {
        case 0:
          roleAuthority = GeneralNames.getInstance(taggedObject, false);
          break;
        case 1:
          roleName = GeneralName.getInstance(taggedObject, true);
          break;
        default:
          throw new IllegalArgumentException("Unknown tag in RoleSyntax");
      }
    }
  }