Package org.apache.directory.shared.kerberos.components

Examples of org.apache.directory.shared.kerberos.components.MethodData


           
            Asn1Decoder decoder = new Asn1Decoder();
            MethodDataContainer container = new MethodDataContainer();
            container.setStream( stream );
            decoder.decode( stream, container );
            MethodData padata = container.getMethodData();
            assertEquals( 2, padata.getPaDatas().length );
            assertEquals( PaDataType.PA_ENCTYPE_INFO2, padata.getPaDatas()[1].getPaDataType() );
            assertEquals( PaDataType.PA_ENC_TIMESTAMP, padata.getPaDatas()[0].getPaDataType() );
        }
    }
View Full Code Here


            Asn1Decoder decoder = new Asn1Decoder();
            MethodDataContainer container = new MethodDataContainer();
            container.setStream( stream );
            decoder.decode( stream, container );
           
            MethodData methodData = container.getMethodData();
           
            for( PaData pd : methodData.getPaDatas() )
            {
                if( pd.getPaDataType() == PaDataType.PA_ENCTYPE_INFO2 )
                {
                    return parseEtpeInfo2( pd.getPaDataValue() );
                }
View Full Code Here

        catch ( EncoderException ioe )
        {
            return null;
        }

        MethodData methodData = new MethodData();

        methodData.addPaData( new PaData( PaDataType.PA_ENC_TIMESTAMP, null ) );

        if ( !isNewEtype )
        {
            methodData.addPaData( new PaData( PaDataType.PA_ENCTYPE_INFO, encTypeInfo ) );
        }

        methodData.addPaData( new PaData( PaDataType.PA_ENCTYPE_INFO2, encTypeInfo2 ) );

        try
        {
            ByteBuffer buffer = ByteBuffer.allocate( methodData.computeLength() );
            return methodData.encode( buffer ).array();
        }
        catch ( EncoderException ee )
        {
            LOG_KRB.warn( "Failed to encode the etype information", ee );
            return null;
View Full Code Here

        {
            fail( de.getMessage() );
        }

        // Check the decoded ETypeInfo
        MethodData methodData = ( ( MethodDataContainer ) methodDataContainer ).getMethodData();

        assertEquals( 2, methodData.getPaDatas().length );

        String[] expected = new String[]
            { "abcdef", "ghijkl" };
        int i = 0;

        for ( PaData paData : methodData.getPaDatas() )
        {
            assertEquals( PaDataType.PA_ENC_TIMESTAMP, paData.getPaDataType() );
            assertTrue( Arrays.equals( Strings.getBytesUtf8( expected[i] ), paData.getPaDataValue() ) );
            i++;
        }

        // Check the encoding
        ByteBuffer bb = ByteBuffer.allocate( methodData.computeLength() );

        try
        {
            bb = methodData.encode( bb );

            // Check the length
            assertEquals( 0x24, bb.limit() );

            String encodedPdu = Strings.dumpBytes( bb.array() );
View Full Code Here

        catch ( EncoderException ioe )
        {
            return null;
        }

        MethodData methodData = new MethodData();

        methodData.addPaData( new PaData( PaDataType.PA_ENC_TIMESTAMP, null ) );

        if ( !isNewEtype )
        {
            methodData.addPaData( new PaData( PaDataType.PA_ENCTYPE_INFO, encTypeInfo ) );
        }

        methodData.addPaData( new PaData( PaDataType.PA_ENCTYPE_INFO2, encTypeInfo2 ) );

        try
        {
            ByteBuffer buffer = ByteBuffer.allocate( methodData.computeLength() );
            return methodData.encode( buffer ).array();
        }
        catch ( EncoderException ee )
        {
            LOG.warn( "Failed to encode the etype information", ee );
            return null;
View Full Code Here

        {
            fail( de.getMessage() );
        }

        // Check the decoded ETypeInfo
        MethodData methodData = ( ( MethodDataContainer ) methodDataContainer ).getMethodData();

        assertEquals( 2, methodData.getPaDatas().length );

        String[] expected = new String[]
            { "abcdef", "ghijkl" };
        int i = 0;

        for ( PaData paData : methodData.getPaDatas() )
        {
            assertEquals( PaDataType.PA_ENC_TIMESTAMP, paData.getPaDataType() );
            assertTrue( Arrays.equals( Strings.getBytesUtf8( expected[i] ), paData.getPaDataValue() ) );
            i++;
        }

        // Check the encoding
        ByteBuffer bb = ByteBuffer.allocate( methodData.computeLength() );

        try
        {
            bb = methodData.encode( bb );

            // Check the length
            assertEquals( 0x24, bb.limit() );

            String encodedPdu = Strings.dumpBytes( bb.array() );
View Full Code Here

            return null;
        }

        PaData responsePaData = new PaData( PaDataType.PA_ENCTYPE_INFO, encTypeInfo );

        MethodData methodData = new MethodData();
        methodData.addPaData( responsePaData );

        try
        {
            ByteBuffer buffer = ByteBuffer.allocate( methodData.computeLength() );
            return methodData.encode( buffer ).array();
        }
        catch ( EncoderException ee )
        {
            return null;
        }
View Full Code Here

        {
            fail( de.getMessage() );
        }

        // Check the decoded ETypeInfo
        MethodData methodData = ( ( MethodDataContainer ) methodDataContainer ).getMethodData();

        assertEquals( 2, methodData.getPaDatas().length );
       
        String[] expected = new String[]{ "abcdef", "ghijkl" };
        int i = 0;
       
        for ( PaData paData : methodData.getPaDatas() )
        {
            assertEquals( PaDataType.PA_ENC_TIMESTAMP, paData.getPaDataType() );
            assertTrue( Arrays.equals( Strings.getBytesUtf8(expected[i]), paData.getPaDataValue() ) );
            i++;
        }

        // Check the encoding
        ByteBuffer bb = ByteBuffer.allocate( methodData.computeLength() );
       
        try
        {
            bb = methodData.encode( bb );
   
            // Check the length
            assertEquals( 0x24, bb.limit() );
   
            String encodedPdu = Strings.dumpBytes(bb.array());
View Full Code Here

            return null;
        }

        PaData responsePaData = new PaData( PaDataType.PA_ENCTYPE_INFO, encTypeInfo );

        MethodData methodData = new MethodData();
        methodData.addPaData( responsePaData );

        try
        {
            ByteBuffer buffer = ByteBuffer.allocate( methodData.computeLength() );
            return methodData.encode( buffer ).array();
        }
        catch ( EncoderException ee )
        {
            return null;
        }
View Full Code Here

            return null;
        }

        PaData responsePaData = new PaData( PaDataType.PA_ENCTYPE_INFO, encTypeInfo );

        MethodData methodData = new MethodData();
        methodData.addPaData( responsePaData );

        try
        {
            ByteBuffer buffer = ByteBuffer.allocate( methodData.computeLength() );
            return methodData.encode( buffer ).array();
        }
        catch ( EncoderException ee )
        {
            return null;
        }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.kerberos.components.MethodData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.