Examples of encode()


Examples of org.apache.directory.shared.kerberos.messages.EncTgsRepPart.encode()

        // Check the encoding
        ByteBuffer encodedPdu = ByteBuffer.allocate( length );

        try
        {
            encodedPdu = encTgsRepPart.encode( encodedPdu );

            // Check the length
            assertEquals( 0xA2, encodedPdu.limit() );
        }
        catch ( EncoderException ee )

Examples of org.apache.directory.shared.kerberos.messages.KrbCred.encode()

        expected.setEncPart( encPart );

        int krbCredLen = expected.computeLength();
        ByteBuffer stream = ByteBuffer.allocate( krbCredLen );

        expected.encode( stream );
        stream.flip();

        KrbCredContainer container = new KrbCredContainer( stream );

        Asn1Decoder decoder = new Asn1Decoder();

Examples of org.apache.directory.shared.kerberos.messages.KrbError.encode()

        assertEquals( streamLen, encodedLen );

        ByteBuffer buffer = ByteBuffer.allocate( streamLen );
        try
        {
            buffer = krbError.encode( buffer );

            assertEquals( decoded, Strings.dumpBytes( buffer.array() ) );
        }
        catch ( EncoderException e )
        {

Examples of org.apache.directory.shared.kerberos.messages.KrbPriv.encode()

        assertEquals( streamLen, encodedLen );

        try
        {
            ByteBuffer bb = ByteBuffer.allocate( encodedLen );
            krbPriv.encode( bb );

            String encoded = Strings.dumpBytes( bb.array() );
            assertEquals( decoded, encoded );
        }
        catch ( EncoderException e )

Examples of org.apache.directory.shared.kerberos.messages.KrbSafe.encode()

        assertEquals( streamLen, encodedLen );

        try
        {
            ByteBuffer bb = ByteBuffer.allocate( encodedLen );
            krbSafe.encode( bb );

            String encoded = Strings.dumpBytes( bb.array() );
            assertEquals( decoded, encoded );
        }
        catch ( EncoderException e )

Examples of org.apache.directory.shared.kerberos.messages.TgsRep.encode()

        // Check the encoding
        ByteBuffer encodedPdu = ByteBuffer.allocate( length );

        try
        {
            encodedPdu = tgsRep.encode( encodedPdu );

            // Check the length
            assertEquals( 0xAC, encodedPdu.limit() );
        }
        catch ( EncoderException ee )

Examples of org.apache.directory.shared.kerberos.messages.TgsReq.encode()

        // Check the encoding
        ByteBuffer encodedPdu = ByteBuffer.allocate( length );

        try
        {
            encodedPdu = tgsReq.encode( encodedPdu );

            // Check the length
            assertEquals( 0x193, encodedPdu.limit() );
        }
        catch ( EncoderException ee )

Examples of org.apache.directory.shared.kerberos.messages.Ticket.encode()

        EncryptionKey serverKey = ticketFactory.getServerKey( serverPrincipal, serverPassword );

        Ticket serviceTicket = ticketFactory.getTicket( clientPrincipal, serverPrincipal, serverKey );

        byte[] encodedTicket = serviceTicket.encode( null ).array();

        byte[] expectedResult = new byte[]
            {
                0x61, ( byte ) 0x81, ( byte ) 0xE7,
                0x30, ( byte ) 0x81, ( byte ) 0xE4,

Examples of org.apache.directory.shared.ldap.codec.LdapMessage.encode()

        message.setMessageId( request.getMessageId() );

        ByteBuffer bb = null;

        bb = message.encode( null );

        bb.flip();

        sendMessage( bb );

Examples of org.apache.directory.shared.ldap.codec.LdapMessageCodec.encode()

    public void encode( IoSession session, Object request, ProtocolEncoderOutput out ) throws Exception
    {
        if ( request instanceof LdapMessageCodec )
        {
            LdapMessageCodec ldapRequest = (LdapMessageCodec)request;
            ByteBuffer bb = ldapRequest.encode();
            bb.flip();
           
            IoBuffer buffer = IoBuffer.allocate( bb.limit(), false );
            buffer.setAutoExpand( false );
            buffer.put( bb );
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.