e-data [12] OCTET STRING OPTIONAL
}
*/
private ErrorMessage decodeErrorMessageSequence( DERSequence sequence )
{
ErrorMessageModifier errorModifier = new ErrorMessageModifier();
KerberosPrincipalModifier clientModifier = new KerberosPrincipalModifier();
KerberosPrincipalModifier serverModifier = 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:
// DERInteger tag0 = ( DERInteger ) derObject;
// int pvno = tag0.intValue();
break;
case 1:
// DERInteger tag1 = ( DERInteger ) derObject;
// msgType = MessageType.getTypeByOrdinal( tag1.intValue() );
break;
case 2:
DERGeneralizedTime tag2 = ( DERGeneralizedTime ) derObject;
errorModifier.setClientTime( KerberosTimeDecoder.decode( tag2 ) );
break;
case 3:
DERInteger tag3 = ( DERInteger ) derObject;
errorModifier.setClientMicroSecond( tag3.intValue() );
break;
case 4:
DERGeneralizedTime tag4 = ( DERGeneralizedTime ) derObject;
errorModifier.setServerTime( KerberosTimeDecoder.decode( tag4 ) );
break;
case 5:
DERInteger tag5 = ( DERInteger ) derObject;
errorModifier.setServerMicroSecond( tag5.intValue() );
break;
case 6:
DERInteger tag6 = ( DERInteger ) derObject;
errorModifier.setErrorCode( tag6.intValue() );
break;
case 7:
DERGeneralString tag7 = ( DERGeneralString ) derObject;
clientModifier.setRealm( tag7.getString() );
break;
case 8:
DERSequence tag8 = ( DERSequence ) derObject;
clientModifier.setPrincipalName( PrincipalNameDecoder.decode( tag8 ) );
break;
case 9:
DERGeneralString tag9 = ( DERGeneralString ) derObject;
serverModifier.setRealm( tag9.getString() );
break;
case 10:
DERSequence tag10 = ( DERSequence ) derObject;
serverModifier.setPrincipalName( PrincipalNameDecoder.decode( tag10 ) );
break;
case 11:
DERGeneralString tag11 = ( DERGeneralString ) derObject;
errorModifier.setExplanatoryText( tag11.getString() );
break;
case 12:
DEROctetString tag12 = ( DEROctetString ) derObject;
errorModifier.setExplanatoryData( tag12.getOctets() );
break;
}
}
errorModifier.setClientPrincipal( clientModifier.getKerberosPrincipal() );
errorModifier.setServerPrincipal( serverModifier.getKerberosPrincipal() );
return errorModifier.getErrorMessage();
}