{
long now = System.currentTimeMillis();
// Get the mutable ticket part.
KerberosPrincipal clientPrincipal = new KerberosPrincipal( "hnelson@EXAMPLE.COM" );
EncTicketPartModifier encTicketPartModifier = getTicketArchetype( clientPrincipal );
// Make changes to test.
encTicketPartModifier.setFlag( TicketFlag.MAY_POSTDATE );
// Service ticket end time will be limited by TGT end time.
encTicketPartModifier.setEndTime( new KerberosTime( now + 3 * KerberosTime.DAY ) );
// Seal the ticket for the server.
KerberosPrincipal serverPrincipal = new KerberosPrincipal( "krbtgt/EXAMPLE.COM@EXAMPLE.COM" );
String passPhrase = "randomKey";
EncryptionKey serverKey = getEncryptionKey( serverPrincipal, passPhrase );