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