Examples of IncomingMessage


Examples of gnu.javax.crypto.key.IncomingMessage

        harness.fail("while User (A) is in step #1");
      }
    harness.check(!A.isComplete(), "User (A) is OK after step #1");

    // (2) host receives user identity and key, and generates its own
    IncomingMessage in = null;
    try
      {
        in = new IncomingMessage(out.toByteArray());
      }
    catch (KeyAgreementException x)
      {
        harness.debug(x);
        harness.fail("while feeding Host (B), User's (A) incoming message");
      }
    out = null;
    try
      {
        out = B.processMessage(in);
      }
    catch (KeyAgreementException x)
      {
        harness.debug(x);
        harness.fail("while Host (B) is in step #1");
      }
    harness.check(B.isComplete(), "Host (B) is complete after step #1");

    byte[] k2 = null;
    try
      {
        k2 = B.getSharedSecret();
      }
    catch (KeyAgreementException x)
      {
        harness.fail("while accessing Host's (B) version of the shared secret");
      }

    // A computes the shared secret
    in = null;
    try
      {
        in = new IncomingMessage(out.toByteArray());
      }
    catch (KeyAgreementException x)
      {
        harness.debug(x);
        harness.fail("while feeding User (A), Host's (B) incoming message");
View Full Code Here

Examples of gnu.javax.crypto.key.IncomingMessage

        harness.fail("while Client (A) is in step #1");
      }
    harness.check(!A.isComplete(), "Client (A) is OK after step #1");

    // (2) host receives user identity, and generates its own public key
    IncomingMessage in = null;
    try
      {
        in = new IncomingMessage(out.toByteArray());
      }
    catch (KeyAgreementException x)
      {
        harness.debug(x);
        harness.fail("while feeding Server (B), Client's (A) incoming message");
      }
    out = null;
    try
      {
        out = B.processMessage(in);
      }
    catch (KeyAgreementException x)
      {
        harness.debug(x);
        harness.fail("while Server (B) is in step #1");
      }
    harness.check(!B.isComplete(), "Server (B) is OK after step #1");

    // (3) A computes the shared secret
    in = null;
    try
      {
        in = new IncomingMessage(out.toByteArray());
      }
    catch (KeyAgreementException x)
      {
        harness.debug(x);
        harness.fail("while feeding Client (A), Server's (B) incoming message");
      }
    out = null;
    try
      {
        out = A.processMessage(in);
      }
    catch (KeyAgreementException x)
      {
        harness.debug(x);
        harness.fail("while User (A) is in step #2");
      }
    harness.check(A.isComplete(), "Client (A) is complete after step #2");

    byte[] k1 = null;
    try
      {
        k1 = A.getSharedSecret();
      }
    catch (KeyAgreementException x)
      {
        harness.fail("while accessing Client's (A) version of the shared secret");
      }

    // (4) B computes the shared secret
    in = null;
    try
      {
        in = new IncomingMessage(out.toByteArray());
      }
    catch (KeyAgreementException x)
      {
        harness.debug(x);
        harness.fail("while feeding Server (B), Client's (A) incoming message");
View Full Code Here

Examples of gnu.javax.crypto.key.IncomingMessage

        harness.fail("while A is in step #1");
      }
    harness.check(!A.isComplete(), "A is OK after step #1");

    // (2) B -> A: g^^y mod p
    IncomingMessage in = null;
    try
      {
        in = new IncomingMessage(out.toByteArray());
      }
    catch (KeyAgreementException x)
      {
        harness.debug(x);
        harness.fail("while feeding B, A's incoming message");
      }
    out = null;
    try
      {
        out = B.processMessage(in);
      }
    catch (KeyAgreementException x)
      {
        harness.debug(x);
        harness.fail("while B is in step #1");
      }
    harness.check(B.isComplete(), "B is complete after step #1");

    byte[] k2 = null;
    try
      {
        k2 = B.getSharedSecret();
      }
    catch (KeyAgreementException x)
      {
        harness.fail("while accessing B's version of the shared secret");
      }

    // A computes the shared secret
    in = null;
    try
      {
        in = new IncomingMessage(out.toByteArray());
      }
    catch (KeyAgreementException x)
      {
        harness.debug(x);
        harness.fail("while feeding A, B's incoming message");
View Full Code Here

Examples of gnu.javax.crypto.key.IncomingMessage

        harness.debug(x);
        harness.fail("while A is in step #1");
      }
    harness.check(A.isComplete(), "A is complete after step #1");

    IncomingMessage in = null;
    try
      {
        in = new IncomingMessage(out.toByteArray());
      }
    catch (KeyAgreementException x)
      {
        harness.debug(x);
        harness.fail("while feeding B, A's incoming message");
View Full Code Here

Examples of org.apache.qpid.server.protocol.v0_8.IncomingMessage

        headers.setString("Test", "MST");
        properties.setHeaders(headers);

        MessagePublishInfo messageInfo = new TestMessagePublishInfo(exchange, false, false, routingKey);

        final IncomingMessage currentMessage;


        currentMessage = new IncomingMessage(messageInfo);

        currentMessage.setExchange(exchange);

        ContentHeaderBody headerBody = new ContentHeaderBody(BasicConsumeBodyImpl.CLASS_ID,0,properties,0l);

        try
        {
            currentMessage.setContentHeaderBody(headerBody);
        }
        catch (AMQException e)
        {
            fail(e.getMessage());
        }

        currentMessage.setExpiration();

        MessageMetaData mmd = currentMessage.headersReceived(System.currentTimeMillis());
        currentMessage.setStoredMessage(getVirtualHost().getMessageStore().addMessage(mmd));
        currentMessage.getStoredMessage().flushToStore();
        currentMessage.route();


        // check and deliver if header says body length is zero
        if (currentMessage.allContentReceived())
        {
            ServerTransaction trans = new AutoCommitTransaction(getVirtualHost().getMessageStore());
            final List<? extends BaseQueue> destinationQueues = currentMessage.getDestinationQueues();
            trans.enqueue(currentMessage.getDestinationQueues(), currentMessage, new ServerTransaction.Action() {
                public void postCommit()
                {
                    try
                    {
                        AMQMessage message = new AMQMessage(currentMessage.getStoredMessage());

                        for(BaseQueue queue : destinationQueues)
                        {
                            queue.enqueue(message);
                        }
View Full Code Here

Examples of org.apache.qpid.server.protocol.v0_8.IncomingMessage

        headers.setString("Test", "MST");
        properties.setHeaders(headers);

        MessagePublishInfo messageInfo = new TestMessagePublishInfo(exchange, false, false, routingKey);

        final IncomingMessage currentMessage;


        currentMessage = new IncomingMessage(messageInfo);

        currentMessage.setExchange(exchange);

        ContentHeaderBody headerBody = new ContentHeaderBody(BasicConsumeBodyImpl.CLASS_ID,0,properties,0l);

        try
        {
            currentMessage.setContentHeaderBody(headerBody);
        }
        catch (AMQException e)
        {
            fail(e.getMessage());
        }

        currentMessage.setExpiration();

        MessageMetaData mmd = currentMessage.headersReceived(System.currentTimeMillis());
        currentMessage.setStoredMessage(getVirtualHost().getMessageStore().addMessage(mmd));
        currentMessage.getStoredMessage().flushToStore();
        currentMessage.route();


        // check and deliver if header says body length is zero
        if (currentMessage.allContentReceived())
        {
            ServerTransaction trans = new AutoCommitTransaction(getVirtualHost().getMessageStore());
            final List<? extends BaseQueue> destinationQueues = currentMessage.getDestinationQueues();
            trans.enqueue(currentMessage.getDestinationQueues(), currentMessage, new ServerTransaction.Action() {
                public void postCommit()
                {
                    try
                    {
                        AMQMessage message = new AMQMessage(currentMessage.getStoredMessage());

                        for(BaseQueue queue : destinationQueues)
                        {
                            queue.enqueue(message);
                        }
View Full Code Here

Examples of org.apache.qpid.server.queue.IncomingMessage

        String routingKey = info.getRoutingKey() == null ? null : info.getRoutingKey().asString();
        if (!getVirtualHost().getSecurityManager().authorisePublish(info.isImmediate(), routingKey, e.getName()))
        {
            throw new AMQSecurityException("Permission denied: " + e.getName());
        }
        _currentMessage = new IncomingMessage(info, getProtocolSession().getReference());
        _currentMessage.setExchange(e);
    }
View Full Code Here

Examples of org.apache.qpid.server.queue.IncomingMessage

    public boolean onSameConnection(InboundMessage inbound)
    {
        if(inbound instanceof IncomingMessage)
        {
            IncomingMessage incoming = (IncomingMessage) inbound;
            return getProtocolSession().getReference() == incoming.getConnectionReference();
        }
        return false;
    }
View Full Code Here

Examples of org.apache.qpid.server.queue.IncomingMessage

        String routingKey = info.getRoutingKey() == null ? null : info.getRoutingKey().asString();
        if (!getVirtualHost().getSecurityManager().authorisePublish(info.isImmediate(), routingKey, e.getName()))
        {
            throw new AMQSecurityException("Permission denied: " + e.getName());
        }
        _currentMessage = new IncomingMessage(info, getProtocolSession().getReference());
        _currentMessage.setExchange(e);
    }
View Full Code Here

Examples of org.apache.qpid.server.queue.IncomingMessage

    public boolean onSameConnection(InboundMessage inbound)
    {
        if(inbound instanceof IncomingMessage)
        {
            IncomingMessage incoming = (IncomingMessage) inbound;
            return getProtocolSession().getReference() == incoming.getConnectionReference();
        }
        return false;
    }
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.