Package org.apache.directory.api.asn1

Examples of org.apache.directory.api.asn1.AbstractAsn1Object


{

    @Override
    public void encode( IoSession session, Object message, ProtocolEncoderOutput out ) throws Exception
    {
        AbstractAsn1Object asn1Obj = ( AbstractAsn1Object ) message;
        boolean isTcp = !session.getTransportMetadata().isConnectionless();

        ByteBuffer encodedByteBuf = KerberosEncoder.encode( asn1Obj, isTcp );
        IoBuffer buf = IoBuffer.allocate( encodedByteBuf.remaining() );
        buf.put( encodedByteBuf.array() );
View Full Code Here


*/
public class KerberosEncoder extends ProtocolEncoderAdapter
{
    public void encode( IoSession session, Object message, ProtocolEncoderOutput out ) throws IOException
    {
        AbstractAsn1Object asn1Obj = ( AbstractAsn1Object ) message;
        boolean isTcp = !session.getTransportMetadata().isConnectionless();
        IoBuffer response = null;
        IoBuffer kerberosMessage = null;

        int responseLength = asn1Obj.computeLength();
        kerberosMessage = IoBuffer.allocate( responseLength );

        if ( isTcp )
        {
            response = IoBuffer.allocate( responseLength + 4 );
        }
        else
        {
            response = kerberosMessage;
        }

        try
        {
            asn1Obj.encode( kerberosMessage.buf() );

            if ( isTcp )
            {
                response.putInt( responseLength );
                response.put( kerberosMessage.buf().array() );
View Full Code Here

        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 ) );
        }

        KrbCred krbCred = new KrbCred();
        krbCredContainer.setKrbCred( krbCred );
View Full Code Here

        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 Ticket
        Asn1Decoder decoder = new Asn1Decoder();
View Full Code Here

        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 ) );
        }

        // Create the Ticket now
        Ticket ticket = new Ticket();
View Full Code Here

        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 ) );
        }

        Checksum checksum = checksumContainer.getChecksum();
        // The Checksum's type is an integer
        BerValue value = tlv.getValue();

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

            checksum.setChecksumType( ChecksumType.getTypeByValue( cksumType ) );

            if ( IS_DEBUG )
            {
                LOG.debug( "cksumType : " + cksumType );
            }
        }
        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

        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 ) );
        }

        Checksum checksum = new Checksum();
        checksumContainer.setChecksum( checksum );
View Full Code Here

            { 0x30, 0x00 } );

        stream.flip();

        // Allocate a KDC-REQ Container
        Asn1Container kdcReqContainer = new KdcReqContainer( stream );

        // Decode the KDC-REQ PDU
        kerberosDecoder.decode( stream, kdcReqContainer );
        fail();
    }
View Full Code Here

        } );

        stream.flip();

        // Allocate a KDC-REQ Container
        Asn1Container kdcReqContainer = new KdcReqContainer( stream );

        // Decode the KDC-REQ PDU
        kerberosDecoder.decode( stream, kdcReqContainer );
        fail();
    }
View Full Code Here

        } );

        stream.flip();

        // Allocate a KDC-REQ Container
        Asn1Container kdcReqContainer = new KdcReqContainer( stream );

        // Decode the KDC-REQ PDU
        kerberosDecoder.decode( stream, kdcReqContainer );
        fail();
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.api.asn1.AbstractAsn1Object

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.