kingpub

海内存知己,博客若比邻

 

运用Web Services安全机制对SOAP消息加密(2)

2.2 WebSphere IICE密文登录原理

  WebSphere IICE加密机制是对BLOWFISH算法的一种实现。一旦安装成功,WebSphere IICE会使用此算法产生一个密钥文件同时要保证此文件在客户端和CONNECTOR端的CLASSPATH中。如下是应用BLOWFISH进行加/解密的一个过程示例。

  列表1:应用blowfish进行加、解密过程

客户端的加密过程:

   //Create and encrypt an AuthBundle.
   AuthBundle aB = new AuthBundle(user, password);
   try {
      //Encrypt the auth bundle
      (new BlowfishSealer()).seal(aB);
   } catch(KeyNotFoundException knfe) {
      ...
   }
  

服务器端的解密过程:
...use the sealed bundle to logon to a chosen repository.
      ..
      // Unseal the auth bundle if sealed.
      if(authBundle.isSealed()) {
         // Instantiate an unsealer proxy.
         UnsealerProxy uP = new UnsealerProxy();
         try {
            // Attempt to unseal the bundle.
            // The UnsealerProxy will delegate unsealing
// to a new instance of "my.magic.Unsealer"
            uP.unseal(authBundle);
         } catch(UnsealerNotFoundException unfe) {
            throw new LogonException("Unable … unsealer.", unfe);
         } catch(KeyNotFoundException knfe) {
            throw new LogonException("Unable ….", knfe);
         } catch(InvalidKeyClassException ikce) {
            throw new LogonException("Invalid decryption...", ikce);
         } catch(EncryptionException ee) {
            throw new LogonException("An error ….", ee);
         }
      }
      ...

  2.3 WebSphere IICE Web Services SOAP消息安全概述

  由于WebSphere IICE使用Axis作为SOAP引擎,我们首先需要了解一下Axis的机制。可以说,Axis的任务就是处理消息。当Axis的核心处理逻辑启动时,一系列的句柄会被顺序的调用。调用的顺序是由两个因素来决定的--部署文件和此引擎为客户端还是服务器端。

  WebSphere IICE Web Services会被一系列的客户端和服务器端Axis/JAX-RPC句柄处理。为了能使此安全解决方案正常工作,这些句柄必须被安装并且要保证安装顺序正确。本文提供了两套句柄分别实现消息的加密/解密和消息完整性验证功能,同时要保证这四个句柄被正确的安装在客户端和服务器端的WSDD配置文件中,这样才能保证对于每一个从客户端发出的消息都被客户端的证书加密和签名,同时才能保证服务器端接受到的每一个消息都是被验证的而且每一个消息都经过了解密。这样我们就实现了SOAP消息的完整性和机密性。

  同时,用户可以选择是否使用此安全机制。如果用户倾向于非安全机制,他所需要做的就是注释客户端和服务器端的WSDD配置文件。

posted on 2006-06-08 18:00 xiaofeng 阅读(112) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航:
 

导航

统计

常用链接

留言簿(2)

随笔分类

随笔档案

文章分类

文章档案

收藏夹

搜索

最新评论

阅读排行榜

评论排行榜