Comments (4)
from wse-php.
Yes I installed the latest one via composer a week back.
Following steps i performed for signing and encryption.
(1) I used own Private Key for signing
openssl genrsa -out myprivatekey.pem 1024
(2) Then tried to use own Public Key for encryption
openssl rsa -in myprivatekey.pem -pubout > mypublickey.pem
Using this for encryption shows me message in soap response: 'ASN.1 parse of certificate failed'
(3) Last I extracted public key from website.cer file to encrypt and i am getting the encrypted soap response.
But here decryption throws me this exception
Uncaught Exception: Failure decrypting Data (openssl private) - error:0406506C:rsa routines:rsa_ossl_private_decrypt:data greater than mod len
from wse-php.
I have been successful in figure out the issue rsa_ossl_private_decrypt:data greater than mod len.
Also i was not required to encrypt the soap document. But still i am getting encrypted soap response.
For that i used this example: https://github.com/robrichards/wse-php/blob/master/examples/soap-wsa-example.php
To decrypt the soap response i used below code:
$doc = new DOMDocument(); $doc->loadXML($retVal); $options = array("keys" => array("private" => array("key" => PRIVATE_KEY, "isFile" => true, "isCert" => false))); $objWSSE->decryptSoapDoc($doc, $options);
Now i am getting this exception:
Uncaught exception 'Exception' with message 'Failure decrypting Data (openssl private) - error:0407109F:rsa routines:RSA_padding_check_PKCS1_type_2:pkcs decoding error'
I have attached the encrypted response. Could you please advise what i am doing wrong here ?
response.txt
from wse-php.
I fixed the problem it was the wrong key used in signing soap headers and body.
from wse-php.
Related Issues (20)
- Parameters HOT 1
- Can I use your lib as ws-trust client?
- MTOM Support HOT 2
- WSSE Encryption is not possible in recent versions of PHP. HOT 11
- Release the fix for split function HOT 1
- Support different namespace HOT 3
- 1.2 Release HOT 2
- wse-php not working on WSDL with Inclusivenamespaces and prefixlist HOT 5
- Nonce EncodingType HOT 1
- Library doesn't support PHP 7.2 (without mcrypt extension) HOT 1
- Require at least 3.0.2 version of robrichards/xmlseclibs HOT 1
- No way to get thumbprint from WSSESoapServer, no example usage
- loadKey() in WSSESoapServer needs to specify $isCert=true
- how to sign timestamp HOT 2
- Error for encrypt Data by using public key HOT 2
- Error Hash values do not match HOT 1
- Unused $refNode in EncryptBody method HOT 1
- Problem between encryptSoapDoc that calls addEncryptedKey HOT 1
- How to fix these issues
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wse-php.