* caddr[11] HostAddresses OPTIONAL
* }
*/
private EncKdcRepPart decodeEncKdcRepPartSequence( DERSequence sequence )
{
EncKdcRepPart modifier = new EncKdcRepPart();
KerberosPrincipalModifier principalModifier = new KerberosPrincipalModifier();
for ( Enumeration<DEREncodable> e = sequence.getObjects(); e.hasMoreElements(); )
{
DERTaggedObject object = ( DERTaggedObject ) e.nextElement();
int tag = object.getTagNo();
DEREncodable derObject = object.getObject();
switch ( tag )
{
case 0:
DERSequence tag0 = ( DERSequence ) derObject;
modifier.setKey( EncryptionKeyDecoder.decode( tag0 ) );
break;
case 1:
DERSequence tag1 = ( DERSequence ) derObject;
modifier.setLastRequest( LastRequestDecoder.decodeSequence( tag1 ) );
break;
case 2:
DERInteger tag2 = ( DERInteger ) derObject;
modifier.setNonce( new Integer( tag2.intValue() ) );
break;
case 3:
DERGeneralizedTime tag3 = ( DERGeneralizedTime ) derObject;
modifier.setKeyExpiration( KerberosTimeDecoder.decode( tag3 ) );
break;
case 4:
DERBitString tag4 = ( DERBitString ) derObject;
modifier.setFlags( new TicketFlags( tag4.getOctets() ) );
break;
case 5:
DERGeneralizedTime tag5 = ( DERGeneralizedTime ) derObject;
modifier.setAuthTime( KerberosTimeDecoder.decode( tag5 ) );
break;
case 6:
DERGeneralizedTime tag6 = ( DERGeneralizedTime ) derObject;
modifier.setStartTime( KerberosTimeDecoder.decode( tag6 ) );
break;
case 7:
DERGeneralizedTime tag7 = ( DERGeneralizedTime ) derObject;
modifier.setEndTime( KerberosTimeDecoder.decode( tag7 ) );
break;
case 8:
DERGeneralizedTime tag8 = ( DERGeneralizedTime ) derObject;
modifier.setRenewTill( KerberosTimeDecoder.decode( tag8 ) );
break;
case 9:
DERGeneralString tag9 = ( DERGeneralString ) derObject;
principalModifier.setRealm( tag9.getString() );
break;
case 10:
DERSequence tag10 = ( DERSequence ) derObject;
principalModifier.setPrincipalName( PrincipalNameDecoder.decode( tag10 ) );
break;
case 11:
DERSequence tag11 = ( DERSequence ) derObject;
modifier.setClientAddresses( HostAddressDecoder.decodeSequence( tag11 ) );
break;
}
}
modifier.setServerPrincipal( principalModifier.getKerberosPrincipal() );
return modifier;
}