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

Examples of org.apache.directory.api.asn1.ber.tlv.TLV


    /**
     * {@inheritDoc}
     */
    public void action( ETypeInfo2Container eTypeInfo2Container ) throws DecoderException
    {
        TLV tlv = eTypeInfo2Container.getCurrentTLV();

        // The Length should not be null
        if ( tlv.getLength() == 0 )
        {
            LOG.error( I18n.err( I18n.ERR_04066 ) );

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

        // Now, let's decode the ETYPE-INFO2-ENTRY
        Asn1Decoder etypeInfo2EntryDecoder = new Asn1Decoder();

        ETypeInfo2EntryContainer etypeInfo2EntryContainer = new ETypeInfo2EntryContainer();
        etypeInfo2EntryContainer.setStream( eTypeInfo2Container.getStream() );

        // Compute the start position in the stream for the ETypeInfoEntry to decode :
        // We have to move back to the ETypeInfoEntry tag
        eTypeInfo2Container.rewind();

        // Decode the ETypeInfo2Entry PDU
        try
        {
            etypeInfo2EntryDecoder.decode( eTypeInfo2Container.getStream(), etypeInfo2EntryContainer );
        }
        catch ( DecoderException de )
        {
            throw de;
        }

        // Update the expected length for the current TLV
        tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );

        // Update the parent
        eTypeInfo2Container.updateParent();

        // Store the ETypeInfoEntry in the container
View Full Code Here


    /**
     * {@inheritDoc}
     */
    public void action( ETypeInfo2EntryContainer eTypeInfo2EntryContainer ) throws DecoderException
    {
        TLV tlv = eTypeInfo2EntryContainer.getCurrentTLV();

        // The Length should not be null
        if ( tlv.getLength() == 0 )
        {
            LOG.error( I18n.err( I18n.ERR_04066 ) );

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void action( KdcReqContainer kdcReqContainer ) throws DecoderException
    {
        TLV tlv = kdcReqContainer.getCurrentTLV();

        // The Length should not be null
        if ( tlv.getLength() == 0 )
        {
            LOG.error( I18n.err( I18n.ERR_04066 ) );

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void action( EncKrbCredPartContainer encKrbCredPartContainer ) throws DecoderException
    {
        TLV tlv = encKrbCredPartContainer.getCurrentTLV();

        // The Length should not be null
        if ( tlv.getLength() == 0 )
        {
            LOG.error( I18n.err( I18n.ERR_04066 ) );

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

        // decoder for KrbCredInfo
        Asn1Decoder decoder = new Asn1Decoder();

        // KrbCredInfo container
        KrbCredInfoContainer ticketInfoContainer = new KrbCredInfoContainer();
        ticketInfoContainer.setStream( encKrbCredPartContainer.getStream() );

        encKrbCredPartContainer.rewind();

        try
        {
            // decode KrbCredInfo
            decoder.decode( encKrbCredPartContainer.getStream(), ticketInfoContainer );
        }
        catch ( DecoderException e )
        {
            throw e;
        }

        KrbCredInfo ticketInfo = ticketInfoContainer.getKrbCredInfo();
        // add KrbCredInfo to the list of ticket-info
        encKrbCredPartContainer.getEncKrbCredPart().addTicketInfo( ticketInfo );

        // Update the expected length for the current TLV
        tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );

        // Update the parent
        encKrbCredPartContainer.updateParent();

        encKrbCredPartContainer.setGrammarEndAllowed( true );
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void action( ETypeInfo2EntryContainer eTypeInfo2EntryContainer ) throws DecoderException
    {
        TLV tlv = eTypeInfo2EntryContainer.getCurrentTLV();
        ETypeInfo2Entry etypeInfo2Entry = eTypeInfo2EntryContainer.getETypeInfo2Entry();

        // The Length may be null
        if ( tlv.getLength() != 0 )
        {
            BerValue value = tlv.getValue();

            // The encrypted data may be null
            if ( value.getData() != null )
            {
                String salt = Strings.utf8ToString( value.getData() );
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void action( KdcRepContainer kdcRepContainer ) throws DecoderException
    {
        TLV tlv = kdcRepContainer.getCurrentTLV();

        // The Length can't be null
        if ( tlv.getLength() == 0 )
        {
            LOG.error( I18n.err( I18n.ERR_04066 ) );

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

        // Now, let's decode the PA-DATA
        Asn1Decoder paDataDecoder = new Asn1Decoder();

        PaDataContainer paDataContainer = new PaDataContainer();
        paDataContainer.setStream( kdcRepContainer.getStream() );

        // We have to move back to the PA-DATA tag
        kdcRepContainer.rewind();

        // Decode the PA-DATA PDU
        try
        {
            paDataDecoder.decode( kdcRepContainer.getStream(), paDataContainer );
        }
        catch ( DecoderException de )
        {
            throw de;
        }

        // Update the parent
        kdcRepContainer.updateParent();

        // Update the expected length for the current TLV
        tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );

        // Store the PData in the container
        PaData paData = paDataContainer.getPaData();
        KdcRep kdcRep = kdcRepContainer.getKdcRep();
        kdcRep.addPaData( paData );
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void action( EncKdcRepPartContainer encKdcRepPartContainer ) throws DecoderException
    {
        TLV tlv = encKdcRepPartContainer.getCurrentTLV();

        // The Length should not be null
        if ( tlv.getLength() == 0 )
        {
            LOG.error( I18n.err( I18n.ERR_04066 ) );

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void action( ETypeInfo2EntryContainer eTypeInfo2EntryContainer ) throws DecoderException
    {
        TLV tlv = eTypeInfo2EntryContainer.getCurrentTLV();

        // The Length should not be null
        if ( tlv.getLength() == 0 )
        {
            LOG.error( I18n.err( I18n.ERR_04066 ) );

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

        // The etype is an integer
        BerValue value = tlv.getValue();

        EncryptionType etype = null;
        ETypeInfo2Entry etypeInfo2Entry = eTypeInfo2EntryContainer.getETypeInfo2Entry();

        try
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void action( LastReqContainer lastReqContainer ) throws DecoderException
    {
        TLV tlv = lastReqContainer.getCurrentTLV();

        // The Length should not be null
        if ( tlv.getLength() == 0 )
        {
            LOG.error( I18n.err( I18n.ERR_04066 ) );

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void action( EncryptedDataContainer encryptedDataContainer ) throws DecoderException
    {
        TLV tlv = encryptedDataContainer.getCurrentTLV();

        // The Length should not be null
        if ( tlv.getLength() == 0 )
        {
            LOG.error( I18n.err( I18n.ERR_744_NULL_PDU_LENGTH ) );

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( I18n.err( I18n.ERR_744_NULL_PDU_LENGTH ) );
View Full Code Here

TOP

Related Classes of org.apache.directory.api.asn1.ber.tlv.TLV

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.