* authorization-data[8] AuthorizationData OPTIONAL
* }
*/
protected static Authenticator decode( DERSequence sequence )
{
AuthenticatorModifier modifier = new AuthenticatorModifier();
for ( Enumeration e = sequence.getObjects(); e.hasMoreElements(); )
{
DERTaggedObject object = ( DERTaggedObject ) e.nextElement();
int tag = object.getTagNo();
DEREncodable derObject = object.getObject();
switch ( tag )
{
case 0:
DERInteger tag0 = ( DERInteger ) derObject;
modifier.setVersionNumber( tag0.intValue() );
break;
case 1:
DERGeneralString tag1 = ( DERGeneralString ) derObject;
modifier.setClientRealm( tag1.getString() );
break;
case 2:
DERSequence tag2 = ( DERSequence ) derObject;
modifier.setClientName( PrincipalNameDecoder.decode( tag2 ) );
break;
case 3:
DERSequence tag3 = ( DERSequence ) derObject;
modifier.setChecksum( ChecksumDecoder.decode( tag3 ) );
break;
case 4:
DERInteger tag4 = ( DERInteger ) derObject;
modifier.setClientMicroSecond( tag4.intValue() );
break;
case 5:
DERGeneralizedTime tag5 = ( DERGeneralizedTime ) derObject;
modifier.setClientTime( KerberosTimeDecoder.decode( tag5 ) );
break;
case 6:
DERSequence tag6 = ( DERSequence ) derObject;
modifier.setSubSessionKey( EncryptionKeyDecoder.decode( tag6 ) );
break;
case 7:
DERInteger tag7 = ( DERInteger ) derObject;
modifier.setSequenceNumber( tag7.intValue() );
break;
case 8:
DERSequence tag8 = ( DERSequence ) derObject;
modifier.setAuthorizationData( AuthorizationDataDecoder.decodeSequence( tag8 ) );
break;
}
}
return modifier.getAuthenticator();
}