| * Test the decoding of a PrincipalName
*/
@Test(expected = DecoderException.class)
public void testPrincipalNameBadName2() throws DecoderException
{
Asn1Decoder kerberosDecoder = new Asn1Decoder();
ByteBuffer stream = ByteBuffer.allocate( 0x29 );
stream.put( new byte[]
{ 0x30, 0x27,
( byte ) 0xA0, 0x03, // name-type
0x02,
0x01,
0x01, // NT-PRINCIPAL
( byte ) 0xA1,
0x20, // name-string
0x30,
0x1E,
0x1B,
0x08,
'h',
'n',
'e',
'l',
's',
'o',
'n',
'1',
0x1B,
0x08,
'h',
'n',
'e',
'\r',
's',
'o',
'n',
'2',
0x1B,
0x08,
'h',
'n',
'e',
'l',
's',
'o',
'n',
'3',
} );
stream.flip();
// Allocate a PrincipalName Container
Asn1Container principalNameContainer = new PrincipalNameContainer();
// Decode the PrincipalName PDU
kerberosDecoder.decode( stream, principalNameContainer );
}
|