Asn1Decoder kdcReqDecoder = new Asn1Decoder();
KdcReqContainer kdcReqContainer = new KdcReqContainer( tgsReqContainer.getStream() );
// Store the created TGS-REQ object into the KDC-REQ container
TgsReq tgsReq = new TgsReq();
kdcReqContainer.setKdcReq( tgsReq );
// Decode the KDC_REQ PDU
try
{
kdcReqDecoder.decode( tgsReqContainer.getStream(), kdcReqContainer );
}
catch ( DecoderException de )
{
throw de;
}
// Update the expected length for the current TLV
tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
// Update the parent
tgsReqContainer.updateParent();
if ( tgsReq.getMessageType() != KerberosMessageType.TGS_REQ )
{
throw new DecoderException( "Bad message type" );
}
tgsReqContainer.setTgsReq( tgsReq );