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

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


        KerberosTime renewtill = new KerberosTime( time );

        HostAddresses caddr = new HostAddresses( new HostAddress[]
            { new HostAddress( InetAddress.getByName( "localhost" ) ) } );

        AuthorizationData authzData = new AuthorizationData();
        authzData.createNewAD();
        authzData.setCurrentAdType( AuthorizationType.AD_IF_RELEVANT );
        authzData.setCurrentAdData( new byte[]
            { 0, 1 } );

        expected = new EncTicketPart();
        expected.setFlags( flags );
        expected.setKey( key );
View Full Code Here


        catch ( DecoderException de )
        {
            fail( de.getMessage() );
        }

        AuthorizationData authData = authDataContainer.getAuthorizationData();

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

        String[] expected = new String[]
            { "abcdef", "ghi" };
        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() ) );

        }

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

        try
        {
            bb = authData.encode( bb );

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

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

        {
            throw new KerberosException( ErrorType.KRB_AP_ERR_BAD_INTEGRITY, de );
        }

        // get the decoded AuthorizationData
        AuthorizationData authorizationData = ( ( AuthorizationDataContainer ) authorizationDataContainer ).getAuthorizationData();

        return authorizationData;
    }
View Full Code Here

        {
            addrs = new HostAddresses(addr);
        }
       
        AuthorizationDataEntry[] auDataEntries = readAuth();
        AuthorizationData auData = null;
        if (auDataEntries != null)
        {
          auData = new AuthorizationData();
          for (AuthorizationDataEntry ade : auDataEntries)
          {
            auData.addEntry(ade);
          }
        }
       
        byte[] ticketData = readData();
        byte[] ticketData2 = readData();
View Full Code Here

        if ( request.getKdcReqBody().getEncAuthorizationData() != null )
        {
            byte[] authorizationData = cipherTextHandler.decrypt( authenticator.getSubKey(), request.getKdcReqBody()
                .getEncAuthorizationData(), KeyUsage.TGS_REQ_KDC_REQ_BODY_AUTHZ_DATA_ENC_WITH_TGS_SESS_KEY );
            AuthorizationData authData = KerberosDecoder.decodeAuthorizationData( authorizationData );
            authData.addEntry( tgt.getEncTicketPart().getAuthorizationData().getCurrentAD() );
            newTicketPart.setAuthorizationData( authData );
        }

        processTransited( newTicketPart, tgt );
View Full Code Here

        catch ( DecoderException de )
        {
            throw de;
        }

        AuthorizationData authorizationData = authorizationDataContainer.getAuthorizationData();

        if ( IS_DEBUG )
        {
            LOG.debug( "AuthorizationData : " + authorizationData );
        }
View Full Code Here

    @Override
    protected void setIntegerValue( int value, AuthorizationDataContainer authorizationDataContainer )
    {
        AuthorizationType authType = AuthorizationType.getTypeByValue( value );

        AuthorizationData authorizationData = authorizationDataContainer.getAuthorizationData();
        authorizationData.createNewAD();
        authorizationData.setCurrentAdType( authType );

        if ( IS_DEBUG )
        {
            LOG.debug( "zdType : {}", authType );
        }
View Full Code Here

            throw new DecoderException( I18n.err( I18n.ERR_744_NULL_PDU_LENGTH ) );
        }

        if ( authorizationDataContainer.getAuthorizationData() == null )
        {
            AuthorizationData authData = new AuthorizationData();
            authorizationDataContainer.setAuthorizationData( authData );

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

        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() ) );

        }
View Full Code Here

        // 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() ) );

        }
View Full Code Here

TOP

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

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.