public class TicketTest
{
@Test
public void testTicket() throws Exception
{
TicketFactory ticketFactory = new TicketFactory();
KerberosPrincipal clientPrincipal = new KerberosPrincipal( "hnelson@EXAMPLE.COM" );
KerberosPrincipal serverPrincipal = new KerberosPrincipal( "kadmin/changepw@EXAMPLE.COM" );
String serverPassword = "s3crEt";
EncryptionKey serverKey = ticketFactory.getServerKey( serverPrincipal, serverPassword );
Ticket serviceTicket = ticketFactory.getTicket( clientPrincipal, serverPrincipal, serverKey );
byte[] encodedTicket = TicketEncoder.encodeTicket( serviceTicket );
ByteBuffer encoded = serviceTicket.encode();