Code Monkey home page Code Monkey logo

Comments (4)

robrichards avatar robrichards commented on June 29, 2024

from wse-php.

Keyur1991 avatar Keyur1991 commented on June 29, 2024

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.

Keyur1991 avatar Keyur1991 commented on June 29, 2024

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.

Keyur1991 avatar Keyur1991 commented on June 29, 2024

I fixed the problem it was the wrong key used in signing soap headers and body.

from wse-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.