Examples of CryptDataHolder


Examples of org.xmlBlaster.authentication.plugins.CryptDataHolder

      MsgQueueGetEntry getEntry = (MsgQueueGetEntry)entry;

      String key = getEntry.getGetKey().toXml();
      String qos = getEntry.getGetQos().toXml();
      if (this.securityInterceptor != null) {  // We export/encrypt the message (call the interceptor)
         CryptDataHolder dataHolder = new CryptDataHolder(MethodName.GET, new MsgUnitRaw(key, (byte[])null, qos));
         MsgUnitRaw msgUnitRaw = securityInterceptor.exportMessage(dataHolder);
         key = msgUnitRaw.getKey();
         qos = msgUnitRaw.getQos();
         if (log.isLoggable(Level.FINE)) log.fine("Exported/encrypted get request.");
      }
      else {
         log.warning("No session security context, get request is not encrypted");
      }

      MsgUnitRaw[] rawReturnValArr = this.driver.get(key, qos); // Invoke remote server

      connectionsHandler.getDispatchStatistic().incrNumGet(1);
     
      MsgUnit[] msgUnitArr = new MsgUnit[rawReturnValArr.length];
      if (getEntry.wantReturnObj()) {
         for (int ii=0; ii<rawReturnValArr.length; ii++) {
            if (this.securityInterceptor != null) { // decrypt return value ...
               CryptDataHolder dataHolder = new CryptDataHolder(MethodName.GET, rawReturnValArr[ii]);
               dataHolder.setReturnValue(true);
               rawReturnValArr[ii] = securityInterceptor.importMessage(dataHolder);
            }
            // NOTE: We use PUBLISH here instead of GET_RETURN to have the whole MsgUnit stored
            msgUnitArr[ii] = new MsgUnit(glob, rawReturnValArr[ii], MethodName.PUBLISH);
         }
View Full Code Here

Examples of org.xmlBlaster.authentication.plugins.CryptDataHolder

      MsgQueueEraseEntry eraseEntry = (MsgQueueEraseEntry)entry;

      String key = eraseEntry.getEraseKey().toXml();
      String qos = eraseEntry.getEraseQos().toXml();
      if (securityInterceptor != null) {  // We export/encrypt the message (call the interceptor)
         CryptDataHolder dataHolder = new CryptDataHolder(MethodName.ERASE, new MsgUnitRaw(key, (byte[])null, qos));
         MsgUnitRaw msgUnitRaw = securityInterceptor.exportMessage(dataHolder);
         key = msgUnitRaw.getKey();
         qos = msgUnitRaw.getQos();
         if (log.isLoggable(Level.FINE)) log.fine("Exported/encrypted erase request.");
      }
      else {
         log.warning("No session security context, erase request is not encrypted");
      }

      String[] rawReturnValArr = this.driver.erase(key, qos); // Invoke remote server

      connectionsHandler.getDispatchStatistic().incrNumErase(1);
     
      if (eraseEntry.wantReturnObj()) {
         EraseReturnQos[] retQosArr = new EraseReturnQos[rawReturnValArr.length];
         for (int ii=0; ii<rawReturnValArr.length; ii++) {
            if (securityInterceptor != null) { // decrypt return value ...
               CryptDataHolder dataHolder = new CryptDataHolder(MethodName.ERASE, new MsgUnitRaw(null, (byte[])null, rawReturnValArr[ii]));
               dataHolder.setReturnValue(true);
               String xmlQos = securityInterceptor.importMessage(dataHolder).getQos();
               retQosArr[ii] = new EraseReturnQos(glob, xmlQos);
            }
         }
View Full Code Here

Examples of org.xmlBlaster.authentication.plugins.CryptDataHolder

      }
      cqd.addClientProperty(Constants.CLIENTPROPERTY_UTC, IsoDateParser.getCurrentUTCTimestamp());
      this.connectQosData = cqd;
      if (this.securityInterceptor != null) {  // We export/encrypt the message (call the interceptor)
          if (log.isLoggable(Level.FINE)) log.fine("TODO: Crypting msg with exportMessage() is not supported for connect() as the server currently can't handle encrypted ConnectQos (for SOCKET see HandleClient.java:234)");
          CryptDataHolder dataHolder = new CryptDataHolder(MethodName.CONNECT, new MsgUnitRaw(null, (byte[])null, cqd.toXml()));
          String encryptedConnectQos = this.securityInterceptor.exportMessage(dataHolder).getQos();
          if (log.isLoggable(Level.FINE)) log.fine("Exported/encrypted connect request.");
          return encryptedConnectQos;
      }
      else {
View Full Code Here

Examples of org.xmlBlaster.authentication.plugins.CryptDataHolder

      String rawReturnVal = this.driver.connect(encryptedConnectQos); // Invoke remote server

      connectionsHandler.getDispatchStatistic().incrNumConnect(1);
     
      if (securityInterceptor != null) { // decrypt return value ...
         CryptDataHolder dataHolder = new CryptDataHolder(MethodName.CONNECT, new MsgUnitRaw(null, (byte[])null, rawReturnVal));
         dataHolder.setReturnValue(true);
         rawReturnVal = securityInterceptor.importMessage(dataHolder).getQos();
      }

      try {
         this.connectReturnQos = new ConnectReturnQos(glob, rawReturnVal);
View Full Code Here

Examples of org.xmlBlaster.authentication.plugins.CryptDataHolder

    */
   private void disconnect(MsgQueueEntry entry) throws XmlBlasterException {
      MsgQueueDisconnectEntry disconnectEntry = (MsgQueueDisconnectEntry)entry;
      String qos = disconnectEntry.getDisconnectQos().toXml();
      if (securityInterceptor != null) {  // We export/encrypt the message (call the interceptor)
         CryptDataHolder dataHolder = new CryptDataHolder(MethodName.DISCONNECT, new MsgUnitRaw(null, (byte[])null, qos));
         qos = securityInterceptor.exportMessage(dataHolder).getQos();
         if (log.isLoggable(Level.FINE)) log.fine("Exported/encrypted disconnect request.");
      }
      else {
         log.warning("No session security context, disconnect request is not encrypted");
View Full Code Here

Examples of org.xmlBlaster.authentication.plugins.CryptDataHolder

      String rawReturnVal = this.driver.connect(encryptedConnectQos); // Invoke remote server

      connectionsHandler.getDispatchStatistic().incrNumConnect(1);
     
      if (securityInterceptor != null) { // decrypt return value ...
         CryptDataHolder dataHolder = new CryptDataHolder(MethodName.CONNECT, new MsgUnitRaw(null, (byte[])null, rawReturnVal));
         dataHolder.setReturnValue(true);
         rawReturnVal = securityInterceptor.importMessage(dataHolder).getQos();
      }

      this.connectReturnQos = null;
      try {
View Full Code Here

Examples of org.xmlBlaster.authentication.plugins.CryptDataHolder

         }
         else {
            // todo: use map=ConnectQos.getClientProperties() as a map to pass to dataHolder
         }

         CryptDataHolder dataHolder = new CryptDataHolder(methodName, holder.msgUnitRaw, map);
         holder.msgUnitRaw = securityInterceptor.exportMessage(dataHolder);
      }
      if (log.isLoggable(Level.FINE)) log.fine(ME+": Exported/encrypted " + holderList.size() + " " + methodName + " messages.");
   }
View Full Code Here

Examples of org.xmlBlaster.authentication.plugins.CryptDataHolder

               if (!entry.wantReturnObj())
                  continue;

               if (securityInterceptor != null) {
                  // decrypt ...
                  CryptDataHolder dataHolder = new CryptDataHolder(MethodName.UPDATE,
                        new MsgUnitRaw(null, (byte[])null, rawReturnVal[i]));
                  dataHolder.setReturnValue(true);
                  rawReturnVal[i] = securityInterceptor.importMessage(dataHolder).getQos();
               }

               // create object
               try {
View Full Code Here

Examples of org.xmlBlaster.authentication.plugins.CryptDataHolder

   {
      // import (decrypt) message
      I_ClientPlugin secPlgn = getSecurityPlugin();
      if (secPlgn != null) {
         MsgUnitRaw in = new MsgUnitRaw(updateKeyLiteral, content, updateQosLiteral);
         CryptDataHolder dataHolder = new CryptDataHolder(MethodName.UPDATE, in, null);
         MsgUnitRaw msg = secPlgn.importMessage(dataHolder);
         updateKeyLiteral = msg.getKey();
         content = msg.getContent();
         updateQosLiteral = msg.getQos();
      }

      // parse XML key and QoS
      UpdateKey updateKey = null;
      UpdateQos updateQos = null;
      try {
         updateKey = new UpdateKey(glob, updateKeyLiteral);
         //updateKey.init(updateKeyLiteral); // does the parsing
         updateQos = new UpdateQos(glob, updateQosLiteral); // does the parsing
      }
      catch (XmlBlasterException e) {
         log.severe("Parsing error: " + e.toString());
         throw new XmlBlasterException(glob, ErrorCode.USER_UPDATE_ILLEGALARGUMENT, ME+".update", "Parsing error", e);
      }

      // invoke client code
      try {
         // Now we know all about the received message, dump it or do some checks
         /*
         if (log.isLoggable(Level.FINEST)) log.dump(ME+".UpdateKey", "\n" + updateKey.toXml());
         if (log.isLoggable(Level.FINEST)) log.dump(ME+".content", "\n" + new String(content));
         if (log.isLoggable(Level.FINEST)) log.dump(ME+".UpdateQos", "\n" + updateQos.toXml());
         */
         if (log.isLoggable(Level.FINE)) log.fine("Received message [" + updateKey.getOid() + "] from publisher " + updateQos.getSender());

         String ret = update(cbSessionId, updateKey, content, updateQos);

         DispatchStatistic statistic = getDispatchStatistic();
         if (statistic != null) statistic.incrNumUpdate(1);
        
         // export (encrypt) return value
         if (secPlgn != null) {
            MsgUnitRaw msg = new MsgUnitRaw(null, (byte[])null, ret);
            CryptDataHolder dataHolder = new CryptDataHolder(MethodName.UPDATE, msg, null);
            dataHolder.setReturnValue(true);
            ret = secPlgn.exportMessage(dataHolder).getQos();
         }

         return ret;
      }
View Full Code Here

Examples of org.xmlBlaster.authentication.plugins.CryptDataHolder

   {
      try {
         I_ClientPlugin secPlgn = getSecurityPlugin();
         if (secPlgn != null) {
            MsgUnitRaw in = new MsgUnitRaw(updateKeyLiteral, content, updateQosLiteral);
            CryptDataHolder dataHolder = new CryptDataHolder(MethodName.UPDATE_ONEWAY, in, null);
            MsgUnitRaw msg = secPlgn.importMessage(dataHolder);

            updateKeyLiteral = msg.getKey();
            content = msg.getContent();
            updateQosLiteral = msg.getQos();
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.