锘??xml version="1.0" encoding="utf-8" standalone="yes"?>日韩在线看片,亚洲精品免费一二三区,亚洲美女在线视频http://www.aygfsteel.com/daniel-shen/category/22124.htmlzh-cnSun, 29 Apr 2007 14:34:44 GMTSun, 29 Apr 2007 14:34:44 GMT60閫氳繃Rampart灝哠OAP淇℃伅瀹夊叏浼犺緭(鎸塧pache鐨剈ser guide緲昏瘧錛屽笇鏈涘ぇ瀹惰ˉ鍏?http://www.aygfsteel.com/daniel-shen/archive/2007/04/29/114629.html灝忓嚒灝忓嚒Sun, 29 Apr 2007 10:40:00 GMThttp://www.aygfsteel.com/daniel-shen/archive/2007/04/29/114629.htmlhttp://www.aygfsteel.com/daniel-shen/comments/114629.htmlhttp://www.aygfsteel.com/daniel-shen/archive/2007/04/29/114629.html#Feedback0http://www.aygfsteel.com/daniel-shen/comments/commentRss/114629.htmlhttp://www.aygfsteel.com/daniel-shen/services/trackbacks/114629.html閫氳繃Rampart灝?/span>SOAP淇℃伅瀹夊叏浼犺緭

 

AXIS2鎷ユ湁涓涓熀浜?/span>apache wss4j鎻愪緵ws-security鐨勬ā鍧楋紝鍙?/span>Rampart銆傝繖綃囨枃妗f彁渚涗簡榪愯鍜岄厤緗?/span>Rampart妯″潡鐨勪俊鎭?/span>

 

浠嬬粛錛?/span>

       褰?/span>rampart妯″潡鍦ㄧ郴緇熸寚瀹氱殑瀹夊叏闃舵鎻掑叆浜嗗鐞嗗櫒涔嬪悗錛屽畠鏄叏灞璧蜂綔鐢ㄧ殑銆傝繖浜涘鐞嗗櫒鍙互浣跨敤ws-securitypolicy[2]鍜?/span>rempart鎸囧畾鐨勭瓥鐣ユ潵閰嶇疆銆?/span>Rampart-1.0浣跨敤涓や釜axis2鍙傛暟鏉ラ厤緗紝榪欑閰嶇疆鏂規硶鍒頒簡1.1榪樺湪浣跨敤銆?/span>

Rampart1.1錛?/span>http://www.apache.org/dyn/closer.cgi/ws/rampart/1_1

棣栧厛錛岄渶瑕佸皢涓嬮潰鐨勮鍙ユ彃鍏ュ埌axis2.xml鏂囦歡涓?/span>

<module ref=”rampart”/>

 

褰?/span>axis2閰嶇疆鍒版湇鍔″櫒濡?/span>tomcat鏃訛紝鍙互浣跨敤web鐨勭鐞嗘帴鍙c?/span>

鍦ㄦ湇鍔″櫒錛屼負姣忎釜鏈嶅姟鎻愪緵瀹夊叏鏄彲鑳界殑銆傞厤緗弬鏁伴渶瑕佸湪service.xml鏂囦歡涓瀹氥?/span>

 鍦ㄥ鎴風閰嶇疆鍙傛暟闇瑕佸湪client’s axis2 repository鐨?/span>axis2.xml涓緗?/span>

 

Rampart-1.1 閰嶇疆

       Rampart鎸囧畾鐨勫0鏄?/span>

       Rampart浣跨敤鏍囧噯鐨?/span>ws-securitypolicy[2]澹版槑錛屼篃鑳藉畾涔夎嚜宸辯殑澹版槑銆?/span>

       Rampart鎸囧畾鐨勫0鏄?/span>xsd鏂囨。錛?/span>http://ws.apache.org/axis2/modules/rampart/1_1/sec-conf/rampart-config.xsd

       Ramp錛?/span>rampartconfig蹇呴』浣滀負欏跺眰澹版槑鏈夋晥錛屽http://ws.apache.org/axis2/modules/rampart/1_1/sec-conf/sample-policy.xml

 

鏈嶅姟绔厤緗?/span>

       闇瑕佸湪services.xml鏂囦歡涓鍔?/span>policy鍏冪礌鏉ラ厤緗湇鍔°備竴涓彲鐢ㄧ殑service.xml錛?/span>

http://ws.apache.org/axis2/modules/rampart/1_1/sec-conf/sample-services.xml

瀹㈡埛绔厤緗?/span>

       鍦ㄥ鎴風錛岄渶瑕佸垱寤轟竴涓?/span>policy瀵硅薄錛屽皢鍏惰澆鍏?/span>options.鍒涘緩policy瀵硅薄鑳戒嬌鐢?/span>policy.xml鏂囦歡錛屽涓嬶細

//Creating the object

       StAXOMBuilder builder = new StAXOMBuilder(pathToPolicyfile);

        Policy clientPolicy = PolicyEngine.getPolicy(builder.getDocumentElement());

        //setting the object

        Options options = new Options();

        options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, clientPolicy);

 

rampart-1.0閰嶇疆

rampart妯″潡浣跨敤涓や釜鍙傛暟錛?/span>outflowsecurity鍜?/span>inflowsecurity

OutflowSecurity鍙傛暟錛?/span>

榪欎釜鍙傛暟鏄敤鏉ラ厤緗?/span>outflow瀹夊叏澶勭悊鍣ㄧ殑銆?/span>Outflow澶勭悊鍣ㄨ兘鍦ㄤ竴涓?/span>outflow錛?/span>one can provde configuration for each of these invocations錛変腑璋冪敤澶氭.”action”鎻忚堪浜嗕竴縐嶈繖鏍風殑閰嶇疆銆傚洜姝?/span>”outflowsecurity”鍙傛暟鑳藉寘鍚涓?/span>’action’鍏冪礌銆?/span>’action’鍏冪礌鐨?/span>schema錛?/span>http://ws.apache.org/axis2/modules/rampart/1_1/sec-conf/out-action.xsd

緇?/span>outflow閰嶇疆澧炲姞涓涓椂闂存埑錛?/span>http://ws.apache.org/axis2/modules/rampart/1_1/security-module.html#ex1鏄粰淇℃伅絳懼瓧鍜屽姞瀵嗙殑渚嬪瓙錛?/span>http://ws.apache.org/axis2/modules/rampart/1_1/security-module.html#ex1 婕旂ず浜嗗浣曢氳繃榪為攣outflow澶勭悊鍣ㄥ皢淇℃伅絳懼悕涓ゆ錛堜嬌鐢ㄤ袱涓?#8216;action’鍏冪礌錛?/span>

涓嬮潰鏄?/span>outflowsecurity 鍙傛暟鑳芥斁鍦?/span>’action’鍏冪礌閲岄潰鐨勫厓绱犳弿榪?/span>

Parameter

Description

Example

items

Security actions for the inflow

Add a Timestamp, Sign the SOAP body and Encrypt the SOAP body

<items> Timestamp Signature Encrypt</items>

user

The user's name

Set alias of the key to be used to sign

<user> bob</user>

passwordCallbackClass

Callback class used to provide the password required to create the UsernameToken or to sign the message

<passwordCallbackClass> org.apache.axis2.security.PWCallback</passwordCallbackClass>

signaturePropFile

property file used to get the signature parameters such as crypto provider, keystore and its password

Set example.properties file as the signature property file

<signaturePropFile> example.properties</signaturePropFile>

signatureKeyIdentifier

Key identifier to be used in referring the key in the signature

Use the serial number of the certificate

<signatureKeyIdentifier> IssuerSerial</signatureKeyIdentifier>

encryptionKeyIdentifier

Key identifier to be used in referring the key in encryption

Use the serial number of the certificate

<encryptionKeyIdentifier>IssuerSerial</encryptionKeyIdentifier>

encryptionUser

The user's name for encryption.



<encryptionUser>alice</encryptionUser>

encryptionSymAlgorithm

Symmetric algorithm to be used for encryption

Use AES-128

<encryptionSymAlgorithm> http://www.w3.org/2001/04/xmlenc#aes128-cbc</encryptionSymAlgorithm>

encryptionKeyTransportAlgorithm

Key encryption algorithm

Use RSA-OAEP

<parameter name="encryptionSymAlgorithm"> http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p</parameter>

signatureParts

Sign multiple parts in the SOAP message

Sign Foo and Bar elements qualified by "http://app.ns/ns"

<signatureParts> {Element}{http://app.ns/ns}Foo;{Element}{http://app.ns/ns}Bar </signatureParts>

optimizeParts

MTOM Optimize the elements specified by the XPath query

Optimize the CipherValue

<optimizeParts> //xenc:EncryptedData/xenc:CipherData/xenc:CipherValue </optimizeParts>

 

InflowSecurity 鍙傛暟

       榪欎釜鍙傛暟鏄潵閰嶇疆inflow 瀹夊叏澶勭悊鍣ㄧ殑銆?/span>’action’涔熻浣跨敤鏉ュ閰嶇疆鍏冪礌榪涜灝佽銆?/span>http://ws.apache.org/axis2/modules/rampart/1_1/security-module.html#ex3 灞曠ず浜嗛厤緗鏄庯紝鏍¢獙絳懼悕鍜岄獙璇佹椂闂存埑銆?/span>

Parameter

Description

Example

items

Security actions for the inflow

first the incoming message should be decrypted and then the signatures should be verified and should be checked for the availability of the Timestamp

<items> Timestamp Signature Encrypt</items>

passwordCallbackClass

Callback class used to obtain password for decryption and UsernameToken verification



<passwordCallbackClass> org.apache.axis2.security.PWCallback</passwordCallbackClass>

signaturePropFile

Property file used for signature verification



<signaturePropFile> sig.properties</signaturePropFile>

decryptionPropFile

Property file used for decryption



<decryptionPropFile> dec.properties</decryptionPropFile>

 

 

璇鋒敞鎰?/span>’.properties’鏂囦歡鍦?/span>properties涓浣跨敤錛屽outsignaturepropfile 鍜屽湪wss4j欏圭洰涓敤鍒扮殑灞炴ф枃浠舵槸涓鏍風殑銆備笅闈㈠睍紺轟簡濡備綍鍦ㄥ睘鎬ф枃浠朵腑瀹氫箟灞炴с?/span>

    org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin

        org.apache.ws.security.crypto.merlin.keystore.type=pkcs12

        org.apache.ws.security.crypto.merlin.keystore.password=security

        org.apache.ws.security.crypto.merlin.keystore.alias=16c73ab6-b892-458f-abf5-2f875f74882e

        org.apache.ws.security.crypto.merlin.alias.password=security

        org.apache.ws.security.crypto.merlin.file=keys/x509.PFX.MSFT

 

org.apache.ws.security.crypto.provider defines the implementation of the org.apache.ws.security.components.crypto.Crypto interface to provide the crypto information required by WSS4J. The other properties defined are the configuration properties used by the implementation class (org.apache.ws.security.components.crypto.Merlin).

 



灝忓嚒 2007-04-29 18:40 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 安图县| 连城县| 南丰县| 驻马店市| 佛山市| 焦作市| 赞皇县| 宜章县| 青海省| 溧阳市| 浏阳市| 广州市| 威信县| 湟源县| 黑龙江省| 霍林郭勒市| 凤翔县| 东方市| 凤冈县| 阳信县| 莲花县| 天镇县| 乃东县| 沈丘县| 辽宁省| 射阳县| 东城区| 浦县| 红安县| 彰武县| 宁明县| 新沂市| 揭东县| 高碑店市| 红原县| 温宿县| 额尔古纳市| 泾阳县| 买车| 大兴区| 苏州市|