kdcReqBody.setEType( encryptionTypes );
kdcReqBody.setNonce( random.nextInt() );
kdcReqBody.setKdcOptions( new KdcOptions() );
long now = System.currentTimeMillis();
KerberosTime requestedEndTime = new KerberosTime( now + KerberosTime.DAY );
kdcReqBody.setTill( requestedEndTime );
String principalName = "hnelson@EXAMPLE.COM";
String passPhrase = "secret";
Set<EncryptionType> preAuthEncryptionTypes = new HashSet<EncryptionType>();
preAuthEncryptionTypes.add( EncryptionType.AES128_CTS_HMAC_SHA1_96 );
Map<EncryptionType, EncryptionKey> keyMap = KerberosKeyFactory.getKerberosKeys( principalName, passPhrase,
preAuthEncryptionTypes );
EncryptionKey clientKey = keyMap.get( EncryptionType.AES128_CTS_HMAC_SHA1_96 );
KerberosTime timeStamp = new KerberosTime();
PaData[] paDatas = getPreAuthEncryptedTimeStamp( clientKey, timeStamp );
KdcReq message = new AsReq();
message.setKdcReqBody( kdcReqBody );