Examples of TLV


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

            catch ( InvalidMarkException ime )
            {
                stream.rewind();
            }

            TLV tlv = kerberosMessageContainer.getCurrentTLV();
            kerberosMessageContainer.setGrammarEndAllowed( true );

            // Now, depending on the T, call the inner decoder
            switch ( tlv.getTag() )
            {
                case KerberosConstants.AS_REQ_TAG:
                    AsReqContainer asReqContainer = new AsReqContainer( stream );

                    // Decode the AS_REQ PDU
View Full Code Here

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

    /**
     * {@inheritDoc}
     */
    public void action( AsReqContainer asReqContainer ) throws DecoderException
    {
        TLV tlv = asReqContainer.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 KDC-REQ
        Asn1Decoder kdcReqDecoder = new Asn1Decoder();

        KdcReqContainer kdcReqContainer = new KdcReqContainer( asReqContainer.getStream() );

        // Store the created AS-REQ object into the KDC-REQ container
        AsReq asReq = new AsReq();
        kdcReqContainer.setKdcReq( asReq );

        // Decode the KDC_REQ PDU
        try
        {
            kdcReqDecoder.decode( asReqContainer.getStream(), kdcReqContainer );
        }
        catch ( DecoderException de )
        {
            throw de;
        }

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

        // Update the parent
        asReqContainer.updateParent();

        if ( asReq.getMessageType() != KerberosMessageType.AS_REQ )
View Full Code Here

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

    /**
     * {@inheritDoc}
     */
    public void action( TypedDataContainer typedDataContainer ) throws DecoderException
    {
        TLV tlv = typedDataContainer.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

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

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

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

            // 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 )
        {
View Full Code Here

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

    /**
     * {@inheritDoc}
     */
    public void action( ApReqContainer apReqContainer ) throws DecoderException
    {
        TLV tlv = apReqContainer.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

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

    /**
     * {@inheritDoc}
     */
    public void action( ApReqContainer apReqContainer ) throws DecoderException
    {
        TLV tlv = apReqContainer.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 Ticket
        Asn1Decoder ticketDecoder = new Asn1Decoder();

        TicketContainer ticketContainer = new TicketContainer( apReqContainer.getStream() );

        // Decode the Ticket PDU
        try
        {
            ticketDecoder.decode( apReqContainer.getStream(), ticketContainer );
        }
        catch ( DecoderException de )
        {
            throw de;
        }

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

        // Update the parent
        apReqContainer.updateParent();

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

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

    /**
     * {@inheritDoc}
     */
    public void action( KrbPrivContainer krbPrivContainer ) throws DecoderException
    {
        TLV tlv = krbPrivContainer.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

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

    /**
     * {@inheritDoc}
     */
    public void action( KdcReqContainer kdcReqContainer ) throws DecoderException
    {
        TLV tlv = kdcReqContainer.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( kdcReqContainer.getStream() );

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

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

        // Update the parent
        kdcReqContainer.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();
        KdcReq kdcReq = kdcReqContainer.getKdcReq();
        kdcReq.addPaData( paData );
View Full Code Here

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

    /**
     * {@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 ) );
View Full Code Here

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

    /**
     * {@inheritDoc}
     */
    public void action( ETypeInfoContainer eTypeInfoContainer ) throws DecoderException
    {
        TLV tlv = eTypeInfoContainer.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-INFO-ENTRY
        Asn1Decoder etypeInfoEntryDecoder = new Asn1Decoder();

        ETypeInfoEntryContainer etypeInfoEntryContainer = new ETypeInfoEntryContainer();
        etypeInfoEntryContainer.setStream( eTypeInfoContainer.getStream() );

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

        // Decode the ETypeInfoEntry PDU
        try
        {
            etypeInfoEntryDecoder.decode( eTypeInfoContainer.getStream(), etypeInfoEntryContainer );
        }
        catch ( DecoderException de )
        {
            throw de;
        }

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

        // Update the parent
        eTypeInfoContainer.updateParent();

        // Store the ETypeInfoEntry in the container
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.