Package org.apache.directory.shared.kerberos.messages

Examples of org.apache.directory.shared.kerberos.messages.EncApRepPart


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

        EncApRepPart encApRepPart = ( ( EncApRepPartContainer ) encApRepPartContainer ).getEncApRepPart();

        // Check the encoding
        int length = encApRepPart.computeLength();

        // Check the length
        assertEquals( 0x33, length );

        // Check the encoding
        ByteBuffer encodedPdu = ByteBuffer.allocate( length );

        try
        {
            encodedPdu = encApRepPart.encode( encodedPdu );

            // Check the length
            assertEquals( 0x33, encodedPdu.limit() );
            assertEquals( decodedPdu, Strings.dumpBytes( encodedPdu.array() ) );
        }
View Full Code Here


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

        EncApRepPart encApRepPart = ( ( EncApRepPartContainer ) encApRepPartContainer ).getEncApRepPart();

        // Check the encoding
        int length = encApRepPart.computeLength();

        // Check the length
        assertEquals( 0x22, length );

        // Check the encoding
        ByteBuffer encodedPdu = ByteBuffer.allocate( length );

        try
        {
            encodedPdu = encApRepPart.encode( encodedPdu );

            // Check the length
            assertEquals( 0x22, encodedPdu.limit() );
            assertEquals( decodedPdu, Strings.dumpBytes( encodedPdu.array() ) );
        }
View Full Code Here

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

        EncApRepPart encApRepPart = ( ( EncApRepPartContainer ) encApRepPartContainer ).getEncApRepPart();

        // Check the encoding
        int length = encApRepPart.computeLength();

        // Check the length
        assertEquals( 0x2D, length );

        // Check the encoding
        ByteBuffer encodedPdu = ByteBuffer.allocate( length );

        try
        {
            encodedPdu = encApRepPart.encode( encodedPdu );

            // Check the length
            assertEquals( 0x2D, encodedPdu.limit() );
            assertEquals( decodedPdu, Strings.dumpBytes( encodedPdu.array() ) );
        }
View Full Code Here

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

        EncApRepPart encApRepPart = ( ( EncApRepPartContainer ) encApRepPartContainer ).getEncApRepPart();

        // Check the encoding
        int length = encApRepPart.computeLength();

        // Check the length
        assertEquals( 0x1C, length );

        // Check the encoding
        ByteBuffer encodedPdu = ByteBuffer.allocate( length );

        try
        {
            encodedPdu = encApRepPart.encode( encodedPdu );

            // Check the length
            assertEquals( 0x1C, encodedPdu.limit() );
            assertEquals( decodedPdu, Strings.dumpBytes( encodedPdu.array() ) );
        }
View Full Code Here

        KrbPriv privateMessage = new KrbPriv();
        privateMessage.setEncPart( encPrivPart );

        // Begin AP_REP generation
        EncApRepPart repPart = new EncApRepPart();
        repPart.setCTime( authenticator.getCtime() );
        repPart.setCusec( authenticator.getCusec() );
       
        if ( authenticator.getSeqNumber() != null )
        {
            repPart.setSeqNumber( authenticator.getSeqNumber() );
        }
       
        repPart.setSubkey( subSessionKey );

        EncryptedData encRepPart;

        try
        {
View Full Code Here

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

        // get the decoded EncApRepPart
        EncApRepPart encApRepPart = ( ( EncApRepPartContainer ) encApRepPartContainer ).getEncApRepPart();

        return encApRepPart;
    }
View Full Code Here

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

        EncApRepPart encApRepPart = new EncApRepPart();
        encApRepPartContainer.setEncApRepPart( encApRepPart );

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

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

        // get the decoded EncApRepPart
        EncApRepPart encApRepPart = ( ( EncApRepPartContainer ) encApRepPartContainer ).getEncApRepPart();

        return encApRepPart;
    }
View Full Code Here

           
            ChangePasswordReply chngPwdReply = ( ChangePasswordReply ) reply;
            ApRep chngApRep = chngPwdReply.getApplicationReply();
            byte[] apRepData = cipherTextHandler.decrypt( tgt.getSessionKey(), chngApRep.getEncPart(), KeyUsage.AP_REP_ENC_PART_SESS_KEY );
           
            EncApRepPart encApRepPart = KerberosDecoder.decodeEncApRepPart( apRepData );
           
            KrbPriv replyPriv = chngPwdReply.getPrivateMessage();
            byte[] data = cipherTextHandler.decrypt( encApRepPart.getSubkey(), replyPriv.getEncPart(), KeyUsage.KRB_PRIV_ENC_PART_CHOSEN_KEY );
            part = KerberosDecoder.decodeEncKrbPrivPart( data );
           
            ChangePasswordResult result = new ChangePasswordResult( part.getUserData() );
           
            return result;
View Full Code Here

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

        // get the decoded EncApRepPart
        EncApRepPart encApRepPart = ( ( EncApRepPartContainer ) encApRepPartContainer ).getEncApRepPart();

        return encApRepPart;
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.kerberos.messages.EncApRepPart

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.