/**
   * return an OriginatorIdentifierOrKey object from a tagged object.
   *
   * @param o the tagged object holding the object we want.
   * @param explicit true if the object is meant to be explicitly tagged false otherwise.
   * @exception IllegalArgumentException if the object held by the tagged object cannot be
   *     converted.
   */
  public static OriginatorIdentifierOrKey getInstance(ASN1TaggedObject o, boolean explicit) {
    if (!explicit) {
      throw new IllegalArgumentException("Can't implicitly tag OriginatorIdentifierOrKey");
    }

    return getInstance(o.getObject());
  }
Beispiel #2
0
  public CrlID(ASN1Sequence seq) {
    Enumeration e = seq.getObjects();

    while (e.hasMoreElements()) {
      ASN1TaggedObject o = (ASN1TaggedObject) e.nextElement();

      switch (o.getTagNo()) {
        case 0:
          crlUrl = DERIA5String.getInstance(o, true);
          break;
        case 1:
          crlNum = DERInteger.getInstance(o, true);
          break;
        case 2:
          crlTime = DERGeneralizedTime.getInstance(o, true);
          break;
        default:
          throw new IllegalArgumentException("unknown tag number: " + o.getTagNo());
      }
    }
  }