0x30 L1 AuthorizationData sequence | +-- 0x30 L2 The AD sequence | +--> 0xA0 L3 adType tag | | | +--> 0x02 L3-1 adType (int) | +--> 0xA1 L4 adData tag | +--> 0x04 L<4-1 adData (OCTET STRING)
119120121122123124125126127128129
assertTrue( Arrays.equals( Strings.getBytesUtf8( expected[i++] ), ad.getAdData() ) ); } // Check the encoding ByteBuffer bb = ByteBuffer.allocate( authData.computeLength() ); try { bb = authData.encode( bb );
4849505152535455565758
{ AuthorizationData ad = new AuthorizationData(); ad.addEntry( new AuthorizationDataEntry( AuthorizationType.AD_KDC_ISSUED, new byte[] { 0x01, 0x02, 0x03, 0x04 } ) ); ByteBuffer encoded = ByteBuffer.allocate( ad.computeLength() ); ad.encode( encoded ); byte[] expectedResult = new byte[] {
7778798081828384858687
ad.addEntry( new AuthorizationDataEntry( AuthorizationType.AD_IF_RELEVANT, new byte[] { 0x05, 0x06, 0x07, 0x08 } ) ); ad.addEntry( new AuthorizationDataEntry( AuthorizationType.AD_MANDATORY_TICKET_EXTENSIONS, new byte[] { 0x09, 0x0A, 0x0B, 0x0C } ) ); ByteBuffer encoded = ByteBuffer.allocate( ad.computeLength() ); ad.encode( encoded ); byte[] expectedResult = new byte[] {
979899100101102103104105106107
assertTrue( Arrays.equals( Strings.getBytesUtf8(expected[i++]), ad.getAdData() ) ); } // Check the encoding ByteBuffer bb = ByteBuffer.allocate( authData.computeLength() ); try { bb = authData.encode( bb );
4748495051525354555657
7677787980818283848586