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

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


        if ( request.getAuthHeader() == null || request.getAuthHeader().getTicket() == null )
        {
            throw new ChangePasswordException( ChangePasswdErrorType.KRB5_KPASSWD_AUTHERROR );
        }

        ApReq authHeader = request.getAuthHeader();
        Ticket ticket = authHeader.getTicket();

        changepwContext.setAuthHeader( authHeader );
        changepwContext.setTicket( ticket );
    }
View Full Code Here


    }
   
   
    private static void verifyServiceTicketAuthHeader( ChangePasswordContext changepwContext ) throws KerberosException
    {
        ApReq authHeader = changepwContext.getAuthHeader();
        Ticket ticket = changepwContext.getTicket();

        EncryptionType encryptionType = ticket.getEncPart().getEType();
        EncryptionKey serverKey = changepwContext.getServerEntry().getKeyMap().get( encryptionType );
View Full Code Here

    private static void monitorContext( ChangePasswordContext changepwContext ) throws KerberosException
    {
        try
        {
            PrincipalStore store = changepwContext.getStore();
            ApReq authHeader = changepwContext.getAuthHeader();
            Ticket ticket = changepwContext.getTicket();
            ReplayCache replayCache = changepwContext.getReplayCache();
            long clockSkew = changepwContext.getConfig().getAllowableClockSkew();

            Authenticator authenticator = changepwContext.getAuthenticator();
View Full Code Here

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

        ApReq apReq = apReqContainer.getApReq();

        assertTrue( apReq instanceof ApReq );

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

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

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

        try
        {
            encodedPdu = apReq.encode( encodedPdu );

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

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

        ApReq apReq = apReqContainer.getApReq();
        ApOptions apOptions = new ApOptions( tlv.getValue().getData() );

        apReq.setApOptions( apOptions );

        if ( IS_DEBUG )
        {
            LOG.debug( "APOptions : {}", apOptions );
        }
View Full Code Here

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

        // Create the AP-REQ now
        ApReq apReq = new ApReq();

        apReqContainer.setApReq( apReq );
    }
View Full Code Here

        // Update the parent
        apReqContainer.updateParent();

        // Store the Ticket in the container
        Ticket ticket = ticketContainer.getTicket();
        ApReq apReq = apReqContainer.getApReq();
        apReq.setTicket( ticket );

        if ( IS_DEBUG )
        {
            LOG.debug( "Stored ticket:  {}", ticket );
        }
View Full Code Here

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

        // get the decoded ApReq
        ApReq apReq = ( ( ApReqContainer ) apReqContainer ).getApReq();

        return apReq;
    }
View Full Code Here

     * @throws IOException
     */
    protected PaData[] getPreAuthenticationData( Ticket ticket, EncryptedData authenticator )
        throws EncoderException
    {
        ApReq applicationRequest = new ApReq();
        applicationRequest.setApOptions( new ApOptions() );
        applicationRequest.setTicket( ticket );
        applicationRequest.setAuthenticator( authenticator );

        ByteBuffer buffer = ByteBuffer.allocate( applicationRequest.computeLength() );
        byte[] encodedApReq = applicationRequest.encode( buffer ).array();

        PaData[] paData = new PaData[1];

        PaData preAuth = new PaData();
        preAuth.setPaDataType( PaDataType.PA_TGS_REQ );
View Full Code Here

    {
        ByteBuffer chngpwdReqData = ByteBuffer.wrap( kpasswdApReqpkt );
       
        ChangePasswordRequest chngPwdReq = ( ChangePasswordRequest ) ChangePasswordDecoder.decode( chngpwdReqData, false );

        ApReq apReq = chngPwdReq.getAuthHeader();
        byte[] decryptedAuthenticator = cipherTextHandler.decrypt( sessionKey, apReq.getAuthenticator(), KeyUsage.AP_REQ_AUTHNT_SESS_KEY );
        Authenticator authenticator = KerberosDecoder.decodeAuthenticator( decryptedAuthenticator );
        subSessionKey = authenticator.getSubKey();
    }
View Full Code Here

TOP

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

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.