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


        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

        {
            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

public class AuthorizationDataTest
{
    @Test
    public void testAuthorizationDataOneAD() throws Exception
    {
        AuthorizationData ad = new AuthorizationData();
        ad.addEntry( new AuthorizationDataEntry( AuthorizationType.AD_KDC_ISSUED, new byte[]
            { 0x01, 0x02, 0x03, 0x04 } ) );

        ByteBuffer encoded = ByteBuffer.allocate( ad.computeLength() );

        ad.encode( encoded );

        byte[] expectedResult = new byte[]
            {
              0x30, 0x0F,
                0x30, 0x0d,
View Full Code Here


    @Test
    public void testAuthorizationDataThreeAD() throws Exception
    {
        AuthorizationData ad = new AuthorizationData();
        ad.addEntry( new AuthorizationDataEntry( AuthorizationType.AD_KDC_ISSUED, new byte[]
            { 0x01, 0x02, 0x03, 0x04 } ) );
        ad.addEntry( new AuthorizationDataEntry( AuthorizationType.AD_IF_RELEVANT, new byte[]
            { 0x05, 0x06, 0x07, 0x08 } ) );
        ad.addEntry( new AuthorizationDataEntry( AuthorizationType.AD_MANDATORY_TICKET_EXTENSIONS, new byte[]
            { 0x09, 0x0A, 0x0B, 0x0C } ) );

        ByteBuffer encoded = ByteBuffer.allocate( ad.computeLength() );

        ad.encode( encoded );

        byte[] expectedResult = new byte[]
            {
              0x30, 0x2D,
                0x30, 0x0d,
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.