Examples of ETypeInfo2


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

    private static byte[] preparePreAuthenticationError( EncryptionType requestedType,
        Set<EncryptionType> encryptionTypes )
    {
        boolean isNewEtype = KerberosUtils.isNewEncryptionType( requestedType );

        ETypeInfo2 eTypeInfo2 = new ETypeInfo2();

        ETypeInfo eTypeInfo = new ETypeInfo();

        for ( EncryptionType encryptionType : encryptionTypes )
        {
            if ( !isNewEtype )
            {
                ETypeInfoEntry etypeInfoEntry = new ETypeInfoEntry( encryptionType, null );
                eTypeInfo.addETypeInfoEntry( etypeInfoEntry );
            }

            ETypeInfo2Entry etypeInfo2Entry = new ETypeInfo2Entry( encryptionType );
            eTypeInfo2.addETypeInfo2Entry( etypeInfo2Entry );
        }

        byte[] encTypeInfo = null;
        byte[] encTypeInfo2 = null;
        try
        {
            if ( !isNewEtype )
            {
                ByteBuffer buffer = ByteBuffer.allocate( eTypeInfo.computeLength() );
                encTypeInfo = eTypeInfo.encode( buffer ).array();
            }

            ByteBuffer buffer = ByteBuffer.allocate( eTypeInfo2.computeLength() );
            encTypeInfo2 = eTypeInfo2.encode( buffer ).array();
        }
        catch ( EncoderException ioe )
        {
            return null;
        }
View Full Code Here

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

        Asn1Decoder decoder = new Asn1Decoder();
        ETypeInfo2Container container = new ETypeInfo2Container();
        container.setStream( stream );
        decoder.decode( stream, container );
       
        ETypeInfo2 info2 = container.getETypeInfo2();

        Set<EncryptionType> lstEtypes = new LinkedHashSet<EncryptionType>();
       
        for( ETypeInfo2Entry e2e : info2.getETypeInfo2Entries() )
        {
            lstEtypes.add( e2e.getEType() );
        }
       
        return lstEtypes;
View Full Code Here

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

        {
            fail( de.getMessage() );
        }

        // Check the decoded ETypeInfo2
        ETypeInfo2 etypeInfo2 = ( ( ETypeInfo2Container ) etypeInfo2Container ).getETypeInfo2();

        assertEquals( 2, etypeInfo2.getETypeInfo2Entries().length );

        String[] expected = new String[]
            { "1234", "5678" };
        int i = 0;

        for ( ETypeInfo2Entry etypeInfo2Entry : etypeInfo2.getETypeInfo2Entries() )
        {
            assertEquals( EncryptionType.DES3_CBC_MD5, etypeInfo2Entry.getEType() );
            assertEquals( expected[i], etypeInfo2Entry.getSalt() );
            i++;
        }

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

        try
        {
            bb = etypeInfo2.encode( bb );

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

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

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

    private static byte[] preparePreAuthenticationError( EncryptionType requestedType,
        Set<EncryptionType> encryptionTypes )
    {
        boolean isNewEtype = KerberosUtils.isNewEncryptionType( requestedType );

        ETypeInfo2 eTypeInfo2 = new ETypeInfo2();

        ETypeInfo eTypeInfo = new ETypeInfo();

        for ( EncryptionType encryptionType : encryptionTypes )
        {
            if ( !isNewEtype )
            {
                ETypeInfoEntry etypeInfoEntry = new ETypeInfoEntry( encryptionType, null );
                eTypeInfo.addETypeInfoEntry( etypeInfoEntry );
            }

            ETypeInfo2Entry etypeInfo2Entry = new ETypeInfo2Entry( encryptionType );
            eTypeInfo2.addETypeInfo2Entry( etypeInfo2Entry );
        }

        byte[] encTypeInfo = null;
        byte[] encTypeInfo2 = null;
        try
        {
            if ( !isNewEtype )
            {
                ByteBuffer buffer = ByteBuffer.allocate( eTypeInfo.computeLength() );
                encTypeInfo = eTypeInfo.encode( buffer ).array();
            }

            ByteBuffer buffer = ByteBuffer.allocate( eTypeInfo2.computeLength() );
            encTypeInfo2 = eTypeInfo2.encode( buffer ).array();
        }
        catch ( EncoderException ioe )
        {
            return null;
        }
View Full Code Here

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

        {
            fail( de.getMessage() );
        }

        // Check the decoded ETypeInfo2
        ETypeInfo2 etypeInfo2 = ( ( ETypeInfo2Container ) etypeInfo2Container ).getETypeInfo2();

        assertEquals( 2, etypeInfo2.getETypeInfo2Entries().length );

        String[] expected = new String[]
            { "1234", "5678" };
        int i = 0;

        for ( ETypeInfo2Entry etypeInfo2Entry : etypeInfo2.getETypeInfo2Entries() )
        {
            assertEquals( EncryptionType.DES3_CBC_MD5, etypeInfo2Entry.getEType() );
            assertEquals( expected[i], etypeInfo2Entry.getSalt() );
            i++;
        }

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

        try
        {
            bb = etypeInfo2.encode( bb );

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

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

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

    private static byte[] preparePreAuthenticationError( EncryptionType requestedType,
        Set<EncryptionType> encryptionTypes )
    {
        boolean isNewEtype = KerberosUtils.isNewEncryptionType( requestedType );

        ETypeInfo2 eTypeInfo2 = new ETypeInfo2();

        ETypeInfo eTypeInfo = new ETypeInfo();

        for ( EncryptionType encryptionType : encryptionTypes )
        {
            if ( !isNewEtype )
            {
                ETypeInfoEntry etypeInfoEntry = new ETypeInfoEntry( encryptionType, null );
                eTypeInfo.addETypeInfoEntry( etypeInfoEntry );
            }

            ETypeInfo2Entry etypeInfo2Entry = new ETypeInfo2Entry( encryptionType );
            eTypeInfo2.addETypeInfo2Entry( etypeInfo2Entry );
        }

        byte[] encTypeInfo = null;
        byte[] encTypeInfo2 = null;
        try
        {
            if ( !isNewEtype )
            {
                ByteBuffer buffer = ByteBuffer.allocate( eTypeInfo.computeLength() );
                encTypeInfo = eTypeInfo.encode( buffer ).array();
            }

            ByteBuffer buffer = ByteBuffer.allocate( eTypeInfo2.computeLength() );
            encTypeInfo2 = eTypeInfo2.encode( buffer ).array();
        }
        catch ( EncoderException ioe )
        {
            return null;
        }
View Full Code Here

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

        {
            fail( de.getMessage() );
        }

        // Check the decoded ETypeInfo2
        ETypeInfo2 etypeInfo2 = ( ( ETypeInfo2Container ) etypeInfo2Container ).getETypeInfo2();

        assertEquals( 2, etypeInfo2.getETypeInfo2Entries().length );
       
        String[] expected = new String[]{ "1234", "5678" };
        int i = 0;
       
        for ( ETypeInfo2Entry etypeInfo2Entry : etypeInfo2.getETypeInfo2Entries() )
        {
            assertEquals( EncryptionType.DES3_CBC_MD5, etypeInfo2Entry.getEType() );
            assertEquals( expected[i], etypeInfo2Entry.getSalt() );
            i++;
        }

        // Check the encoding
        ByteBuffer bb = ByteBuffer.allocate( etypeInfo2.computeLength() );
       
        try
        {
            bb = etypeInfo2.encode( bb );
   
            // Check the length
            assertEquals( 0x20, bb.limit() );
   
            String encodedPdu = Strings.dumpBytes(bb.array());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.