password, ciphers );
/** The client's encryption key. */
key = keys.get( ciphers.iterator().next() ); // FIXME this is always taking first cipher, not good
PaData paData = new PaData();
if ( clientOptions.isUsePaEncTimestamp() )
{
PaEncTsEnc paEncTimeStamp = new PaEncTsEnc( new KerberosTime(), 0 );
EncryptedData encryptedData = null;
try
{
encryptedData = lockBox.seal( key, paEncTimeStamp, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
}
catch ( KerberosException ke )
{
LOG.error( "Unexpected exception encrypting timestamp.", ke );
}
ByteBuffer buf = ByteBuffer.allocate( encryptedData.computeLength() );
byte[] encodedEncryptedData = encryptedData.encode( buf ).array();
paData.setPaDataType( PaDataType.PA_ENC_TIMESTAMP );
paData.setPaDataValue( encodedEncryptedData );
}
AsReq request = new AsReq();
request.setKdcReqBody( reqBody );
request.addPaData( paData );