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

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


            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
        }

        AdKdcIssued adKdcIssued = new AdKdcIssued();
        adKdcIssuedContainer.setAdKdcIssued( adKdcIssued );

        if ( IS_DEBUG )
        {
            LOG.debug( "AdKdcIssued created" );
View Full Code Here


        {
            fail( de.getMessage() );
        }

        // Check the decoded AdKdcIssued
        AdKdcIssued adKdcIssued = ( ( AdKdcIssuedContainer ) adKdcIssuedContainer ).getAdKdcIssued();

        Checksum checksum = adKdcIssued.getAdChecksum();

        assertEquals( ChecksumType.getTypeByValue( 2 ), checksum.getChecksumType() );
        assertTrue( Arrays.equals( Strings.getBytesUtf8( "chksum" ), checksum.getChecksumValue() ) );

        assertEquals( "EXAMPLE.COM", adKdcIssued.getIRealm() );

        PrincipalName principalName = adKdcIssued.getISName();

        assertNotNull( principalName );
        assertEquals( PrincipalNameType.KRB_NT_PRINCIPAL, principalName.getNameType() );
        assertTrue( principalName.getNames().contains( "hnelson" ) );

        AuthorizationData authData = adKdcIssued.getElements();

        assertNotNull( authData.getAuthorizationData().size() );
        assertEquals( 2, authData.getAuthorizationData().size() );

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

        for ( AuthorizationDataEntry ad : authData.getAuthorizationData() )
        {
            assertEquals( AuthorizationType.AD_INTENDED_FOR_SERVER, ad.getAdType() );
            assertTrue( Arrays.equals( Strings.getBytesUtf8( expected[i++] ), ad.getAdData() ) );

        }

        ByteBuffer bb = ByteBuffer.allocate( adKdcIssued.computeLength() );

        // Check the encoding
        try
        {
            bb = adKdcIssued.encode( bb );

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

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

        {
            fail( de.getMessage() );
        }

        // Check the decoded AdKdcIssued
        AdKdcIssued adKdcIssued = ( ( AdKdcIssuedContainer ) adKdcIssuedContainer ).getAdKdcIssued();

        // The checksum
        Checksum checksum = adKdcIssued.getAdChecksum();

        assertEquals( ChecksumType.getTypeByValue( 2 ), checksum.getChecksumType() );
        assertTrue( Arrays.equals( Strings.getBytesUtf8( "chksum" ), checksum.getChecksumValue() ) );

        // The realm
        assertNull( adKdcIssued.getIRealm() );

        // The sname
        assertNull( adKdcIssued.getISName() );

        // the elements
        AuthorizationData authData = adKdcIssued.getElements();

        assertNotNull( authData.getAuthorizationData().size() );
        assertEquals( 2, authData.getAuthorizationData().size() );

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

        for ( AuthorizationDataEntry ad : authData.getAuthorizationData() )
        {
            assertEquals( AuthorizationType.AD_INTENDED_FOR_SERVER, ad.getAdType() );
            assertTrue( Arrays.equals( Strings.getBytesUtf8( expected[i++] ), ad.getAdData() ) );

        }

        ByteBuffer bb = ByteBuffer.allocate( adKdcIssued.computeLength() );

        // Check the encoding
        try
        {
            bb = adKdcIssued.encode( bb );

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

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

        {
            fail( de.getMessage() );
        }

        // Check the decoded AdKdcIssued
        AdKdcIssued adKdcIssued = ( ( AdKdcIssuedContainer ) adKdcIssuedContainer ).getAdKdcIssued();

        Checksum checksum = adKdcIssued.getAdChecksum();

        assertEquals( ChecksumType.getTypeByValue( 2 ), checksum.getChecksumType() );
        assertTrue( Arrays.equals( Strings.getBytesUtf8( "chksum" ), checksum.getChecksumValue() ) );

        assertEquals( "EXAMPLE.COM", adKdcIssued.getIRealm() );

        PrincipalName principalName = adKdcIssued.getISName();

        assertNotNull( principalName );
        assertEquals( PrincipalNameType.KRB_NT_PRINCIPAL, principalName.getNameType() );
        assertTrue( principalName.getNames().contains( "hnelson" ) );

        AuthorizationData authData = adKdcIssued.getElements();

        assertNotNull( authData.getAuthorizationData().size() );
        assertEquals( 2, authData.getAuthorizationData().size() );

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

        for ( AuthorizationDataEntry ad : authData.getAuthorizationData() )
        {
            assertEquals( AuthorizationType.AD_INTENDED_FOR_SERVER, ad.getAdType() );
            assertTrue( Arrays.equals( Strings.getBytesUtf8( expected[i++] ), ad.getAdData() ) );

        }

        ByteBuffer bb = ByteBuffer.allocate( adKdcIssued.computeLength() );

        // Check the encoding
        try
        {
            bb = adKdcIssued.encode( bb );

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

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

        {
            fail( de.getMessage() );
        }

        // Check the decoded AdKdcIssued
        AdKdcIssued adKdcIssued = ( ( AdKdcIssuedContainer ) adKdcIssuedContainer ).getAdKdcIssued();

        // The checksum
        Checksum checksum = adKdcIssued.getAdChecksum();

        assertEquals( ChecksumType.getTypeByValue( 2 ), checksum.getChecksumType() );
        assertTrue( Arrays.equals( Strings.getBytesUtf8( "chksum" ), checksum.getChecksumValue() ) );

        // The realm
        assertNull( adKdcIssued.getIRealm() );

        // The sname
        assertNull( adKdcIssued.getISName() );

        // the elements
        AuthorizationData authData = adKdcIssued.getElements();

        assertNotNull( authData.getAuthorizationData().size() );
        assertEquals( 2, authData.getAuthorizationData().size() );

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

        for ( AuthorizationDataEntry ad : authData.getAuthorizationData() )
        {
            assertEquals( AuthorizationType.AD_INTENDED_FOR_SERVER, ad.getAdType() );
            assertTrue( Arrays.equals( Strings.getBytesUtf8( expected[i++] ), ad.getAdData() ) );

        }

        ByteBuffer bb = ByteBuffer.allocate( adKdcIssued.computeLength() );

        // Check the encoding
        try
        {
            bb = adKdcIssued.encode( bb );

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

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

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
        }

        AdKdcIssued adKdcIssued = new AdKdcIssued();
        adKdcIssuedContainer.setAdKdcIssued( adKdcIssued );

        if ( IS_DEBUG )
        {
            LOG.debug( "AdKdcIssued created" );
View Full Code Here

        {
            fail( de.getMessage() );
        }

        // Check the decoded AdKdcIssued
        AdKdcIssued adKdcIssued = ( ( AdKdcIssuedContainer ) adKdcIssuedContainer).getAdKdcIssued();

        Checksum checksum = adKdcIssued.getAdChecksum();
       
        assertEquals( ChecksumType.getTypeByValue( 2 ), checksum.getChecksumType() );
        assertTrue( Arrays.equals( Strings.getBytesUtf8("chksum"), checksum.getChecksumValue() ) );

        assertEquals( "EXAMPLE.COM", adKdcIssued.getIRealm() );
       
        PrincipalName principalName = adKdcIssued.getISName();

        assertNotNull( principalName );
        assertEquals( PrincipalNameType.KRB_NT_PRINCIPAL, principalName.getNameType() );
        assertTrue( principalName.getNames().contains( "hnelson" ) );
       
        AuthorizationData authData = adKdcIssued.getElements();
       
        assertNotNull( authData.getAuthorizationData().size() );
        assertEquals( 2, authData.getAuthorizationData().size() );
       
        String[] expected = new String[]{ "abcdef", "ghijkl" };
        int i = 0;
       
        for ( AuthorizationDataEntry ad : authData.getAuthorizationData() )
        {
            assertEquals( AuthorizationType.AD_INTENDED_FOR_SERVER, ad.getAdType() );
            assertTrue( Arrays.equals( Strings.getBytesUtf8(expected[i++]), ad.getAdData() ) );
           
        }

        ByteBuffer bb = ByteBuffer.allocate( adKdcIssued.computeLength() );

        // Check the encoding
        try
        {
            bb = adKdcIssued.encode( bb );

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

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

        {
            fail( de.getMessage() );
        }

        // Check the decoded AdKdcIssued
        AdKdcIssued adKdcIssued = ( ( AdKdcIssuedContainer ) adKdcIssuedContainer).getAdKdcIssued();

        // The checksum
        Checksum checksum = adKdcIssued.getAdChecksum();
       
        assertEquals( ChecksumType.getTypeByValue( 2 ), checksum.getChecksumType() );
        assertTrue( Arrays.equals( Strings.getBytesUtf8("chksum"), checksum.getChecksumValue() ) );

        // The realm
        assertNull( adKdcIssued.getIRealm() );
       
        // The sname
        assertNull( adKdcIssued.getISName() );

        // the elements
        AuthorizationData authData = adKdcIssued.getElements();
       
        assertNotNull( authData.getAuthorizationData().size() );
        assertEquals( 2, authData.getAuthorizationData().size() );
       
        String[] expected = new String[]{ "abcdef", "ghijkl" };
        int i = 0;
       
        for ( AuthorizationDataEntry ad : authData.getAuthorizationData() )
        {
            assertEquals( AuthorizationType.AD_INTENDED_FOR_SERVER, ad.getAdType() );
            assertTrue( Arrays.equals( Strings.getBytesUtf8(expected[i++]), ad.getAdData() ) );
           
        }

        ByteBuffer bb = ByteBuffer.allocate( adKdcIssued.computeLength() );

        // Check the encoding
        try
        {
            bb = adKdcIssued.encode( bb );

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

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

TOP

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

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.