Package org.apache.directory.shared.asn1.ber.tlv

Examples of org.apache.directory.shared.asn1.ber.tlv.Value


                    // a FF, it's a TRUE. Any other value should be an error,
                    // but we could relax this constraint. So if we have
                    // something
                    // which is not 0, it will be interpreted as TRUE, but we
                    // will generate a warning.
                    Value value = tlv.getValue();

                    try
                    {
                        container.getSubentriesControl().setVisibility( BooleanDecoder.parse( value ) );

                        // We can have an END transition
                        container.setGrammarEndAllowed( true );
                    }
                    catch ( BooleanDecoderException bde )
                    {
                        LOG.error( I18n.err( I18n.ERR_04054, Strings.dumpBytes( value.getData()), bde.getMessage() ) );

                        // This will generate a PROTOCOL_ERROR
                        throw new DecoderException( bde.getMessage() );
                    }
                }
View Full Code Here


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

        Value value = tlv.getValue();

        try
        {
            int number = IntegerDecoder.parse( value, minValue, maxValue );

            if ( IS_DEBUG )
            {
                LOG.debug( "read integer value : {}", number );
            }

            setIntegerValue( number, container );
        }
        catch ( IntegerDecoderException ide )
        {
            LOG.error( I18n.err( I18n.ERR_04070, Strings.dumpBytes( value.getData() ), ide
                .getLocalizedMessage() ) );

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( ide.getMessage(), ide );
        }
View Full Code Here

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

        Value value = tlv.getValue();

        // The data should not be null
        if ( ( value.getData() == null ) && ( !canBeNull ) )
        {
            LOG.error( I18n.err( I18n.ERR_04066 ) );

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

        setOctetString( value.getData(), container );
    }
View Full Code Here

            }

            parent = parent.getParent();
        }

        Value value = current.getValue();

        if ( ( value != null ) && ( value.getData() != null ) )
        {
            return ( current.getExpectedLength() == value.getData().length );
        }
        else
        {
            return current.getExpectedLength() == 0;
        }
View Full Code Here

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

        Value value = tlv.getValue();

        try
        {
            int msgTypeValue = IntegerDecoder.parse( value );

            if ( msgType != null )
            {
                if ( msgType.getValue() == msgTypeValue )
                {
                    LOG.debug( "msg-type : {}", msgType );

                    return;
                }

                String message = I18n.err( I18n.ERR_04070, Strings.dumpBytes(value.getData()) );
                LOG.error( message );

                // This will generate a PROTOCOL_ERROR
                throw new DecoderException( message );
            }
            else
            {
                KerberosMessageType messageType = KerberosMessageType.getTypeByValue( msgTypeValue );

                if ( container instanceof KdcReqContainer )
                {
                    if ( ((KdcReqContainer)container).getKdcReq().getMessageType() == messageType )
                    {
                        return;
                    }
                }
                else if ( container instanceof KdcRepContainer )
                {
                    if ( ((KdcRepContainer)container).getKdcRep().getMessageType() == messageType )
                    {
                        return;
                    }
                }

                String message = I18n.err( I18n.ERR_04070, Strings.dumpBytes(value.getData()) );
                LOG.error( message );

                // This will generate a PROTOCOL_ERROR
                throw new DecoderException( message );
            }
        }
        catch ( IntegerDecoderException ide )
        {
            LOG.error( I18n.err( I18n.ERR_04070, Strings.dumpBytes(value.getData()), ide
                .getLocalizedMessage() ) );

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( ide.getMessage() );
        }
View Full Code Here

            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
        }

        KdcReqBody kdcReqBody = kdcReqBodyContainer.getKdcReqBody();

        Value value = tlv.getValue();

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

            kdcReqBody.addEType( encryptionType );

            if ( IS_DEBUG )
            {
                LOG.debug( "EncryptionType : {}", encryptionType );
            }
        }
        catch ( IntegerDecoderException ide )
        {
            LOG.error( I18n.err( I18n.ERR_04070, Strings.dumpBytes(value.getData()), ide
                .getLocalizedMessage() ) );

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( ide.getMessage() );
        }
View Full Code Here

        }

        KdcReqBody kdcReqBody = kdcReqBodyContainer.getKdcReqBody();

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

        try
        {
            KerberosTime from = new KerberosTime( date );
            kdcReqBody.setFrom( from );
View Full Code Here

        }

        KdcReqBody kdcReqBody = kdcReqBodyContainer.getKdcReqBody();

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

        try
        {
            KerberosTime till = new KerberosTime( date );
            kdcReqBody.setTill( till );
View Full Code Here

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

        // The value is the realm
        Value value = tlv.getValue();
        String eText = Strings.utf8ToString(value.getData());

        KrbError krbError = krbErrorContainer.getKrbError();
        krbError.setEText( eText );

        if ( IS_DEBUG )
View Full Code Here

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

        // The value is the realm
        Value value = tlv.getValue();
        String realm = Strings.utf8ToString(value.getData());

        if ( IS_DEBUG )
        {
            LOG.debug( "read realm value : " + realm );
        }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.asn1.ber.tlv.Value

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.