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

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


            short encodedAppReplyLength = buf.getShort();
           
            byte[] encodedAppReply = new byte[encodedAppReplyLength];
            buf.get( encodedAppReply );
           
            ApRep applicationReply = KerberosDecoder.decodeApRep( encodedAppReply );
           
            int privateBytesLength = messageLength - HEADER_LENGTH - encodedAppReplyLength;
            byte[] encodedPrivateMessage = new byte[privateBytesLength];
            buf.get( encodedPrivateMessage );
           
View Full Code Here


                return result;
            }
           
            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 );
View Full Code Here

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

        // get the decoded ApRep
        ApRep apRep = ( ( ApRepContainer ) apRepContainer ).getApRep();

        return apRep;
    }
View Full Code Here

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

        ApRep apRep = ( ApRep ) kerberosMessageContainer.getMessage();

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

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

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

        try
        {
            encodedPdu = apRep.encode( encodedPdu );

            // Check the length
            assertEquals( 0x21, encodedPdu.limit() );
        }
        catch ( EncoderException ee )
View Full Code Here

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

        ApRep apRep = apRepContainer.getApRep();

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

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

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

        try
        {
            encodedPdu = apRep.encode( encodedPdu );

            // Check the length
            assertEquals( 0x21, encodedPdu.limit() );
        }
        catch ( EncoderException ee )
View Full Code Here

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

        // Create the AP-REP now
        ApRep apRep = new ApRep();

        apRepContainer.setApRep( apRep );
    }
View Full Code Here

        short encodedAppReplyLength = buf.getShort();

        byte[] encodedAppReply = new byte[encodedAppReplyLength];
        buf.get( encodedAppReply );

        ApRep applicationReply = KerberosDecoder.decodeApRep( encodedAppReply );

        int privateBytesLength = messageLength - HEADER_LENGTH - encodedAppReplyLength;
        byte[] encodedPrivateMessage = new byte[privateBytesLength];
        buf.get( encodedPrivateMessage );

        PrivateMessageDecoder privateDecoder = new PrivateMessageDecoder();
        PrivateMessage privateMessage = privateDecoder.decode( encodedPrivateMessage );
        applicationReply.setPrivateMessage( privateMessage );

        return applicationReply.getChangePasswordReply();
    }
View Full Code Here

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

        // get the decoded ApRep
        ApRep apRep = ( ( ApRepContainer ) apRepContainer ).getApRep();

        return apRep;
    }
View Full Code Here

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

        ApRep apRep = apRepContainer.getApRep();
       
        // Check the encoding
        int length = apRep.computeLength();

        // Check the length
        assertEquals( 0x21, length );
       
        // Check the encoding
        ByteBuffer encodedPdu = ByteBuffer.allocate( length );
       
        try
        {
            encodedPdu = apRep.encode( encodedPdu );
           
            // Check the length
            assertEquals( 0x21, encodedPdu.limit() );
        }
        catch ( EncoderException ee )
View Full Code Here

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

        // Create the AP-REP now
        ApRep apRep = new ApRep();

        apRepContainer.setApRep( apRep );
    }
View Full Code Here

TOP

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

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.