calendar.set(calendar.MINUTE,
calendar.set(Calendar.MINUTE,
  private Date makeTime(int tag, byte[] value) throws IOException  {    Calendar calendar = Calendar.getInstance();    String str = makeString(PRINTABLE_STRING, value);    // Classpath's SimpleDateFormat does not work for parsing these    // types of times, so we do this by hand.    String date = str;    String tz = "";    if (str.indexOf("+") > 0)      {        date = str.substring(0, str.indexOf("+"));        tz = str.substring(str.indexOf("+"));      }    else if (str.indexOf("-") > 0)      {        date = str.substring(0, str.indexOf("-"));        tz = str.substring(str.indexOf("-"));      }    else if (str.endsWith("Z"))      {        date = str.substring(0, str.length()-2);        tz = "Z";      }    if (!tz.equals("Z") && tz.length() > 0)      calendar.setTimeZone(TimeZone.getTimeZone(tz));    else      calendar.setTimeZone(TimeZone.getTimeZone("UTC"));    if ((tag & 0x1F) == UTC_TIME)      {        if (date.length() < 10)  // must be at least 10 chars long          throw new DEREncodingException("cannot parse date");        // UTCTime is of the form "yyMMddHHmm[ss](Z|(+|-)hhmm)"        try          {            int year = Integer.parseInt(str.substring(0, 2));            if (year < 50)              year += 2000;            else              year += 1900;            calendar.set(year,              Integer.parseInt(str.substring( 2,  4))-1,  // month              Integer.parseInt(str.substring( 4,  6)),    // day              Integer.parseInt(str.substring( 6,  8)),    // hour              Integer.parseInt(str.substring( 8, 10)));   // minute            if (date.length() == 12);              calendar.set(calendar.SECOND,                Integer.parseInt(str.substring(10, 12)));          }        catch (NumberFormatException nfe)          {            throw new DEREncodingException("cannot parse date");          }      }    else      {        if (date.length() < 10)  // must be at least 10 chars long          throw new DEREncodingException("cannot parse date");        // GeneralTime is of the form "yyyyMMddHH[mm[ss[(.|,)SSSS]]]"        // followed by "Z" or "(+|-)hh[mm]"        try          {            calendar.set(              Integer.parseInt(date.substring(0, 4)),      // year              Integer.parseInt(date.substring(4, 6))-1,    // month              Integer.parseInt(date.substring(6, 8)),      // day              Integer.parseInt(date.substring(8, 10)), 0); // hour, min            switch (date.length())              {                case 19:                case 18:                case 17:                case 16:                  calendar.set(calendar.MILLISECOND,                    Integer.parseInt(date.substring(15)));                case 14:                  calendar.set(calendar.SECOND,                    Integer.parseInt(date.substring(12, 14)));                case 12:                  calendar.set(calendar.MINUTE,                    Integer.parseInt(date.substring(10, 12)));              }          }        catch (NumberFormatException nfe)          {            throw new DEREncodingException("cannot parse date");          }      }    return calendar.getTime();  }