HostAddresses addresses = new HostAddresses();
addresses.addHostAddress( new HostAddress( HostAddrType.ADDRTYPE_INET, "192.168.0.1".getBytes() ) );
addresses.addHostAddress( new HostAddress( HostAddrType.ADDRTYPE_INET, "192.168.0.2".getBytes() ) );
body.setAddresses( addresses );
EncryptedData encAuthorizationData = new EncryptedData( EncryptionType.AES128_CTS_HMAC_SHA1_96,
"abcdef".getBytes() );
body.setEncAuthorizationData( encAuthorizationData );
Ticket ticket1 = new Ticket();
ticket1.setTktVno( 5 );
ticket1.setRealm( "EXAMPLE.COM" );
ticket1.setSName( new PrincipalName( "client", PrincipalNameType.KRB_NT_PRINCIPAL ) );
ticket1.setEncPart( new EncryptedData( EncryptionType.AES128_CTS_HMAC_SHA1_96, "abcdef".getBytes() ) );
body.addAdditionalTicket( ticket1 );
Ticket ticket2 = new Ticket();
ticket2.setTktVno( 5 );
ticket2.setRealm( "EXAMPLE.COM" );
ticket2.setSName( new PrincipalName( "server", PrincipalNameType.KRB_NT_PRINCIPAL ) );
ticket2.setEncPart( new EncryptedData( EncryptionType.AES128_CTS_HMAC_SHA1_96, "abcdef".getBytes() ) );
body.addAdditionalTicket( ticket2 );
// Check the encoding
int length = body.computeLength();