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

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


        {
            fail( de.getMessage() );
        }

        // Check the decoded TransitedEncoding
        TransitedEncoding transitedEncoding = ( ( TransitedEncodingContainer ) transitedEncodingContainer )
            .getTransitedEncoding();

        assertEquals( TransitedEncodingType.DOMAIN_X500_COMPRESS, transitedEncoding.getTrType() );
        assertTrue( Arrays.equals( Strings.getBytesUtf8( "abcdef" ), transitedEncoding.getContents() ) );

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

        try
        {
            bb = transitedEncoding.encode( bb );

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

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


        EncryptionKey sessionKey = RandomKeyFactory.getRandomKey( EncryptionType.DES_CBC_MD5 );

        encTicketPart.setKey( sessionKey );
        encTicketPart.setCName( new PrincipalName( clientPrincipal ) );
        encTicketPart.setCRealm( clientPrincipal.getRealm() );
        encTicketPart.setTransited( new TransitedEncoding() );
        encTicketPart.setAuthTime( new KerberosTime() );

        long now = System.currentTimeMillis();
        KerberosTime endTime = new KerberosTime( now + KerberosTime.DAY );
        encTicketPart.setEndTime( endTime );
View Full Code Here

        EncryptionKey sessionKey = RandomKeyFactory.getRandomKey( EncryptionType.DES_CBC_MD5 );

        encTicketPart.setKey( sessionKey );
        encTicketPart.setCName( new PrincipalName( clientPrincipal ) );
        encTicketPart.setCRealm( clientPrincipal.getRealm() );
        encTicketPart.setTransited( new TransitedEncoding() );
        encTicketPart.setAuthTime( new KerberosTime() );

        long now = System.currentTimeMillis();
        KerberosTime endTime = new KerberosTime( now + KerberosTime.DAY );
        encTicketPart.setEndTime( endTime );
View Full Code Here

        EncryptionKey sessionKey = RandomKeyFactory.getRandomKey( authContext.getEncryptionType() );
        encTicketPart.setKey( sessionKey );

        encTicketPart.setCName( request.getKdcReqBody().getCName() );
        encTicketPart.setCRealm( request.getKdcReqBody().getRealm() );
        encTicketPart.setTransited( new TransitedEncoding() );
        String serverRealm = request.getKdcReqBody().getRealm();

        KerberosTime now = new KerberosTime();

        encTicketPart.setAuthTime( now );
View Full Code Here

        catch ( DecoderException de )
        {
            throw de;
        }

        TransitedEncoding te = transitedContainer.getTransitedEncoding();

        if ( IS_DEBUG )
        {
            LOG.debug( "TransitedEncoding {}", te );
        }
View Full Code Here

        {
            fail( de.getMessage() );
        }

        // Check the decoded TransitedEncoding
        TransitedEncoding transitedEncoding = ( ( TransitedEncodingContainer ) transitedEncodingContainer ).getTransitedEncoding();

        assertEquals( TransitedEncodingType.DOMAIN_X500_COMPRESS, transitedEncoding.getTrType() );
        assertTrue( Arrays.equals( Strings.getBytesUtf8("abcdef"), transitedEncoding.getContents() ) );

        // Check the encoding
        ByteBuffer bb = ByteBuffer.allocate( transitedEncoding.computeLength() );
       
        try
        {
            bb = transitedEncoding.encode( bb );
   
            // Check the length
            assertEquals( len, 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 ) );
        }

        TransitedEncoding transitedEncoding = new TransitedEncoding();
        transitedEncodingContainer.setTransitedEncoding( transitedEncoding );

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

        EncryptionKey sessionKey = RandomKeyFactory.getRandomKey( EncryptionType.DES_CBC_MD5 );

        encTicketPart.setKey( sessionKey );
        encTicketPart.setCName( new PrincipalName( clientPrincipal.getName(), PrincipalNameType.KRB_NT_PRINCIPAL ) );
        encTicketPart.setTransited( new TransitedEncoding() );
        encTicketPart.setAuthTime( new KerberosTime() );

        long now = System.currentTimeMillis();
        KerberosTime endTime = new KerberosTime( now + ONE_DAY );
        encTicketPart.setEndTime( endTime );
View Full Code Here

        EncryptionKey sessionKey = RandomKeyFactory.getRandomKey( authContext.getEncryptionType() );
        encTicketPart.setKey( sessionKey );

        encTicketPart.setCName( request.getKdcReqBody().getCName() );
        encTicketPart.setCRealm( request.getKdcReqBody().getRealm() );
        encTicketPart.setTransited( new TransitedEncoding() );
        String serverRealm = request.getKdcReqBody().getRealm();

        KerberosTime now = new KerberosTime();

        encTicketPart.setAuthTime( now );
View Full Code Here

        String cRealm = "crealm";

        PrincipalName cName = new PrincipalName( "cname", PrincipalNameType.KRB_NT_PRINCIPAL );

        TransitedEncoding transited = new TransitedEncoding();
        transited.setContents( new byte[]
            { 0, 1 } );
        transited.setTrType( TransitedEncodingType.DOMAIN_X500_COMPRESS );

        long time = new Date().getTime();

        KerberosTime authTime = new KerberosTime( time );
View Full Code Here

TOP

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

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.