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

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


           
           
            KrbPriv privateMessage = new KrbPriv();
           
            EncKrbPrivPart part = new EncKrbPrivPart();
            part.setSenderAddress( new HostAddress( InetAddress.getLocalHost() ) );
            part.setSeqNumber( authenticator.getSeqNumber() );
            part.setTimestamp( authenticator.getCtime() );

            short changePwdPVNO = ChangePasswordRequest.PVNO;
           
View Full Code Here


        // Make changes to test.
        encTicketPart.setFlag( TicketFlag.FORWARDABLE );

        HostAddress[] address =
            { new HostAddress( InetAddress.getByAddress( new byte[4] ) ) };
        HostAddresses addresses = new HostAddresses( address );
        encTicketPart.setClientAddresses( addresses );

        // Seal the ticket for the server.
        KerberosPrincipal serverPrincipal = new KerberosPrincipal( "krbtgt/EXAMPLE.COM@EXAMPLE.COM" );
View Full Code Here

        KerberosTime requestedEndTime = new KerberosTime( now + 1 * KerberosTime.DAY );
        kdcReqBody.setTill( requestedEndTime );

        HostAddress[] address =
            { new HostAddress( InetAddress.getLocalHost() ) };
        HostAddresses addresses = new HostAddresses( address );
        kdcReqBody.setAddresses( addresses );

        KdcReq message = getKdcRequest( tgt, kdcReqBody );

View Full Code Here

        // Make changes to test.
        encTicketPart.setFlag( TicketFlag.PROXIABLE );

        HostAddress[] address =
            { new HostAddress( InetAddress.getByAddress( new byte[4] ) ) };
        HostAddresses addresses = new HostAddresses( address );
        encTicketPart.setClientAddresses( addresses );

        // Seal the ticket for the server.
        KerberosPrincipal serverPrincipal = new KerberosPrincipal( "krbtgt/EXAMPLE.COM@EXAMPLE.COM" );
View Full Code Here

        body.addEType( EncryptionType.AES256_CTS_HMAC_SHA1_96 );
        body.addEType( EncryptionType.DES3_CBC_MD5 );
        body.addEType( EncryptionType.AES128_CTS_HMAC_SHA1_96 );

        HostAddresses addresses = new HostAddresses();
        addresses.addHostAddress( new HostAddress( HostAddrType.ADDRTYPE_INET, "192.168.0.1".getBytes() ) );
        addresses.addHostAddress( new HostAddress( HostAddrType.ADDRTYPE_INET, "192.168.0.2".getBytes() ) );
        body.setAddresses( addresses );

        EncryptedData encAuthorizationData = new EncryptedData( EncryptionType.AES128_CTS_HMAC_SHA1_96,
            "abcdef".getBytes() );
        body.setEncAuthorizationData( encAuthorizationData );
View Full Code Here

        {
            throw de;
        }

        // Store the HostAddress in the container
        HostAddress hostAddress = hostAddressContainer.getHostAddress();

        // Update the expected length for the current TLV
        tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );

        // Update the parent
View Full Code Here

        {
            fail( de.getMessage() );
        }

        // Check the decoded HostAddress
        HostAddress hostAddress = ( ( HostAddressContainer ) hostAddressContainer ).getHostAddress();

        assertEquals( HostAddrType.ADDRTYPE_INET, hostAddress.getAddrType() );
        assertTrue( Arrays.equals( Strings.getBytesUtf8( "192.168.0.1" ), hostAddress.getAddress() ) );

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

        try
        {
            bb = hostAddress.encode( bb );

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

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

        sName = new PrincipalName( "sname", PrincipalNameType.KRB_NT_PRINCIPAL );
        optionalFieldValueList.add( new FieldValueHolder( "sName", sName ) );

        clientAddresses = new HostAddresses( new HostAddress[]
            { new HostAddress( InetAddress.getByName( "localhost" ) ) } );
        optionalFieldValueList.add( new FieldValueHolder( "clientAddresses", clientAddresses ) );
    }
View Full Code Here

        // Update the parent
        hostAddressesContainer.updateParent();

        // Store the hostAddress in the container
        HostAddress hostAddress = hostAddressContainer.getHostAddress();
        hostAddressesContainer.addHostAddress( hostAddress );

        if ( IS_DEBUG )
        {
            LOG.debug( "HostAddress added : {}", hostAddress );
View Full Code Here

        }

        EncKrbPrivPart encKrbPrivPart = container.getEncKrbPrivPart();

        String time = "20101119080043Z";
        HostAddress ad = new HostAddress( InetAddress.getByName( "127.0.0.1" ) );

        assertTrue( Arrays.equals( new byte[]
            { 0, 1 }, encKrbPrivPart.getUserData() ) );
        assertEquals( time, encKrbPrivPart.getTimestamp().getDate() );
        assertEquals( 1, encKrbPrivPart.getUsec() );
View Full Code Here

TOP

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

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.