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

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


    {
        // Deny POSTDATED tickets in policy.
        config.setPaEncTimestampRequired( false );
        config.setPostdatedAllowed( false );

        KdcReqBody kdcReqBody = new KdcReqBody();
        kdcReqBody.setCName( getPrincipalName( "hnelson" ) );
        kdcReqBody.setSName( getPrincipalName( "krbtgt/EXAMPLE.COM@EXAMPLE.COM" ) );
        kdcReqBody.setRealm( "EXAMPLE.COM" );
        kdcReqBody.setEType( config.getEncryptionTypes() );

        KdcOptions kdcOptions = new KdcOptions();
        kdcOptions.set( KdcOptions.ALLOW_POSTDATE );
        kdcReqBody.setKdcOptions( kdcOptions );

        long now = System.currentTimeMillis();
        KerberosTime requestedEndTime = new KerberosTime( now + 1 * KerberosTime.DAY );
        kdcReqBody.setTill( requestedEndTime );

        KdcReq message = new AsReq();
        message.setKdcReqBody( kdcReqBody );

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


    {
        // Deny POSTDATED tickets in policy.
        config.setPaEncTimestampRequired( false );
        config.setPostdatedAllowed( false );

        KdcReqBody kdcReqBody = new KdcReqBody();
        kdcReqBody.setCName( getPrincipalName( "hnelson" ) );
        kdcReqBody.setSName( getPrincipalName( "krbtgt/EXAMPLE.COM@EXAMPLE.COM" ) );
        kdcReqBody.setRealm( "EXAMPLE.COM" );
        kdcReqBody.setEType( config.getEncryptionTypes() );

        KdcOptions kdcOptions = new KdcOptions();
        kdcOptions.set( KdcOptions.POSTDATED );
        kdcReqBody.setKdcOptions( kdcOptions );

        long now = System.currentTimeMillis();
        KerberosTime requestedEndTime = new KerberosTime( now + 1 * KerberosTime.DAY );
        kdcReqBody.setTill( requestedEndTime );

        KdcReq message = new AsReq();
        message.setKdcReqBody( kdcReqBody );

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

    {
        // Deny RENEWABLE tickets in policy.
        config.setPaEncTimestampRequired( false );
        config.setRenewableAllowed( false );

        KdcReqBody kdcReqBody = new KdcReqBody();
        kdcReqBody.setCName( getPrincipalName( "hnelson" ) );
        kdcReqBody.setSName( getPrincipalName( "krbtgt/EXAMPLE.COM@EXAMPLE.COM" ) );
        kdcReqBody.setRealm( "EXAMPLE.COM" );
        kdcReqBody.setEType( config.getEncryptionTypes() );

        KdcOptions kdcOptions = new KdcOptions();
        kdcOptions.set( KdcOptions.RENEWABLE_OK );
        kdcReqBody.setKdcOptions( kdcOptions );

        long now = System.currentTimeMillis();
        KerberosTime requestedEndTime = new KerberosTime( now + KerberosTime.WEEK );
        kdcReqBody.setTill( requestedEndTime );

        KdcReq message = new AsReq();
        message.setKdcReqBody( kdcReqBody );

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

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

        KdcReqBody kdcReqBody = kdcReqBodyContainer.getKdcReqBody();

        BerValue value = tlv.getValue();

        try
        {
            int etype = IntegerDecoder.parse( value );
            EncryptionType encryptionType = EncryptionType.getTypeByValue( etype );

            kdcReqBody.addEType( encryptionType );

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

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

        KdcReqBody kdcReqBody = kdcReqBodyContainer.getKdcReqBody();
        KdcOptions kdcOptions = new KdcOptions( tlv.getValue().getData() );

        kdcReqBody.setKdcOptions( kdcOptions );

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

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

        KdcReqBody kdcReqBody = kdcReqBodyContainer.getKdcReqBody();

        // The value is the KerberosTime
        BerValue value = tlv.getValue();
        String date = Strings.utf8ToString( value.getData() );

        try
        {
            KerberosTime from = new KerberosTime( date );
            kdcReqBody.setFrom( from );

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

        // Update the parent
        kdcReqBodyContainer.updateParent();

        // Store the Ticket in the container
        Ticket ticket = ticketContainer.getTicket();
        KdcReqBody kdcReqBody = kdcReqBodyContainer.getKdcReqBody();
        kdcReqBody.addAdditionalTicket( ticket );

        kdcReqBodyContainer.setGrammarEndAllowed( true );

        if ( IS_DEBUG )
        {
View Full Code Here

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

        KdcReqBody kdcReqBody = new KdcReqBody();
        kdcReqBodyContainer.setKdcReqBody( kdcReqBody );

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

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

        KdcReqBody kdcReqBody = kdcReqBodyContainer.getKdcReqBody();

        // The value is the KerberosTime
        BerValue value = tlv.getValue();
        String date = Strings.utf8ToString( value.getData() );

        try
        {
            KerberosTime till = new KerberosTime( date );
            kdcReqBody.setTill( till );

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

     * @throws Exception
     */
    @Test
    public void testServerNotFound() throws Exception
    {
        KdcReqBody kdcReqBody = new KdcReqBody();
        kdcReqBody.setCName( getPrincipalName( "hnelson" ) );
        kdcReqBody.setSName( getPrincipalName( "badserver" ) );
        kdcReqBody.setRealm( "EXAMPLE.COM" );
        kdcReqBody.setEType( config.getEncryptionTypes() );

        KerberosPrincipal clientPrincipal = new KerberosPrincipal( "hnelson@EXAMPLE.COM" );

        String passPhrase = "secret";
        PaData[] paDatas = getPreAuthEncryptedTimeStamp( clientPrincipal, passPhrase );
View Full Code Here

TOP

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

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.