| public class EncKrbPrivPartDecoderTest
{
@Test
public void testDecodeEncKrbPrivPart() throws Exception
{
Asn1Decoder decoder = new Asn1Decoder();
int streamLen = 0x49;
ByteBuffer stream = ByteBuffer.allocate( streamLen );
stream.put( new byte[]
{
0x7C, 0x47,
0x30, 0x45,
( byte ) 0xA0, 0x4, // user-data
0x04,
0x02,
0x00,
0x01,
( byte ) 0xA1,
0x11, // timestamp
0x18,
0xF,
'2',
'0',
'1',
'0',
'1',
'1',
'1',
'9',
'0',
'8',
'0',
'0',
'4',
'3',
'Z',
( byte ) 0xA2,
0x03, // usec
0x02,
0x01,
0x01,
( byte ) 0xA3,
0x03, // seq-number
0x02,
0x01,
0x01,
( byte ) 0xA4,
0xF, // s-address
0x30,
0x0D,
( byte ) 0xA0,
0x03,
0x02,
0x01,
0x02,
( byte ) 0xA1,
0x06,
0x04,
0x04,
127,
0,
0,
1,
( byte ) 0xA5,
0xF, // r-adress
0x30,
0x0D,
( byte ) 0xA0,
0x03,
0x02,
0x01,
0x02,
( byte ) 0xA1,
0x06,
0x04,
0x04,
127,
0,
0,
1
} );
String decoded = Strings.dumpBytes( stream.array() );
stream.flip();
EncKrbPrivPartContainer container = new EncKrbPrivPartContainer( stream );
try
{
decoder.decode( stream, container );
}
catch ( DecoderException e )
{
fail();
}
|