/**
* {@inheritDoc}
*/
public void action( KdcReqContainer kdcReqContainer ) throws DecoderException
{
TLV tlv = kdcReqContainer.getCurrentTLV();
// The Length can't be null
if ( tlv.getLength() == 0 )
{
LOG.error( I18n.err( I18n.ERR_04066 ) );
// This will generate a PROTOCOL_ERROR
throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
}
// Now, let's decode the PA-DATA
Asn1Decoder paDataDecoder = new Asn1Decoder();
PaDataContainer paDataContainer = new PaDataContainer();
paDataContainer.setStream( kdcReqContainer.getStream() );
// We have to move back to the PA-DATA tag
kdcReqContainer.rewind();
// Decode the PA-DATA PDU
try
{
paDataDecoder.decode( kdcReqContainer.getStream(), paDataContainer );
}
catch ( DecoderException de )
{
throw de;
}
// Update the parent
kdcReqContainer.updateParent();
// Update the expected length for the current TLV
tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
// Store the PData in the container
PaData paData = paDataContainer.getPaData();
KdcReq kdcReq = kdcReqContainer.getKdcReq();
kdcReq.addPaData( paData );