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 );
}