*/
public final void testUTCEncoder() throws Exception {
// no fractional seconds (last 3 0s and "." must be trimmed out)
Date myDate = getGmtDate(1101980374187L);
byte[] encoded =
new DerOutputStream(uTime, myDate).encoded;
String rep = new String(encoded, 2, encoded[1] & 0xff, "UTF-8");
assertEquals("no fraction", "041202093934Z", rep);
// midnight
SimpleDateFormat sdf =
new SimpleDateFormat("dd.MM.yyyy HH:mm");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
myDate = sdf.parse("06.06.2004 00:00");
encoded =
new DerOutputStream(uTime, myDate).encoded;
rep = new String(encoded, 2, encoded[1] & 0xff, "UTF-8");
assertEquals("midnight", "040606000000Z", rep);
}