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

Examples of org.apache.directory.server.kerberos.shared.messages.application.PrivateMessage


        // Seal private message part.
        EncryptedData encryptedPrivPart = cipherTextHandler.seal( subSessionKey, encReqPrivPart, KeyUsage.NUMBER13 );

        // Make private message with private message part.
        PrivateMessage privateMessage = new PrivateMessage();
        privateMessage.setProtocolVersionNumber( 5 );
        privateMessage.setMessageType( KerberosMessageType.ENC_PRIV_PART );
        privateMessage.setEncryptedPart( encryptedPrivPart );

        return privateMessage;
    }
View Full Code Here


        ApReq appRequest = message.getAuthHeader();
        ApplicationRequestEncoder appEncoder = new ApplicationRequestEncoder();
        byte[] encodedAppRequest = appEncoder.encode( appRequest );

        // Build private message bytes
        PrivateMessage privateMessage = message.getPrivateMessage();
        PrivateMessageEncoder privateEncoder = new PrivateMessageEncoder();
        byte[] privateBytes = privateEncoder.encode( privateMessage );

        short messageLength = ( short ) ( HEADER_LENGTH + encodedAppRequest.length + privateBytes.length );
View Full Code Here

        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

        ApplicationReply appReply = message.getApplicationReply();
        ApplicationReplyEncoder appEncoder = new ApplicationReplyEncoder();
        byte[] encodedAppReply = appEncoder.encode( appReply );

        // Build private message bytes
        PrivateMessage privateMessage = message.getPrivateMessage();
        PrivateMessageEncoder privateEncoder = new PrivateMessageEncoder();
        byte[] privateBytes = privateEncoder.encode( privateMessage );

        short messageLength = ( short ) ( HEADER_LENGTH + encodedAppReply.length + privateBytes.length );
View Full Code Here

        catch ( KerberosException ke )
        {
            throw new ChangePasswordException( ErrorType.KRB5_KPASSWD_SOFTERROR, ke );
        }

        PrivateMessage privateMessage = new PrivateMessage( encPrivPart );

        // Begin AP_REP generation
        EncApRepPart repPart = new EncApRepPart();
        repPart.setCTime( authenticator.getCtime() );
        repPart.setCusec( authenticator.getCusec() );
View Full Code Here

    {
        try
        {
            ChangePasswordReply reply = ( ChangePasswordReply ) changepwContext.getReply();
            ApplicationReply appReply = reply.getApplicationReply();
            PrivateMessage priv = reply.getPrivateMessage();

            StringBuilder sb = new StringBuilder();
            sb.append( "Responding with change password reply:" );
            sb.append( "\n\t" + "appReply               " + appReply );
            sb.append( "\n\t" + "priv                   " + priv );
View Full Code Here

        apReq.setTicket( serviceTicket );
        apReq.setAuthenticator( encryptedAuthenticator );

        String newPassword = "secretsecret";

        PrivateMessage priv = getChangePasswordPrivateMessage( newPassword, subSessionKey );

        ChangePasswordRequest message = new ChangePasswordRequest( ( short ) 1, apReq, priv );

        handler.messageReceived( session, message );
View Full Code Here

        apReq.setTicket( serviceTicket );
        apReq.setAuthenticator( encryptedAuthenticator );

        String newPassword = "secretsecret";

        PrivateMessage priv = getSetPasswordPrivateMessage( newPassword, subSessionKey, getPrincipalName( "hnelson" ) );

        ChangePasswordRequest message = new ChangePasswordRequest( ( short ) 0xFF80, apReq, priv );

        handler.messageReceived( session, message );
View Full Code Here

        // Seal private message part.
        EncryptedData encryptedPrivPart = cipherTextHandler.seal( subSessionKey, encReqPrivPart, KeyUsage.KRB_PRIV_ENC_PART_CHOSEN_KEY );

        // Make private message with private message part.
        PrivateMessage privateMessage = new PrivateMessage();
        privateMessage.setProtocolVersionNumber( 5 );
        privateMessage.setMessageType( KerberosMessageType.ENC_PRIV_PART );
        privateMessage.setEncryptedPart( encryptedPrivPart );

        return privateMessage;
    }
View Full Code Here

        // Seal private message part.
        EncryptedData encryptedPrivPart = cipherTextHandler.seal( subSessionKey, encReqPrivPart, KeyUsage.KRB_PRIV_ENC_PART_CHOSEN_KEY );

        // Make private message with private message part.
        PrivateMessage privateMessage = new PrivateMessage();
        privateMessage.setProtocolVersionNumber( 5 );
        privateMessage.setMessageType( KerberosMessageType.ENC_PRIV_PART );
        privateMessage.setEncryptedPart( encryptedPrivPart );

        return privateMessage;
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.server.kerberos.shared.messages.application.PrivateMessage

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.