I have a bash script in linux that works correclty, but i wantes to port the code to BJ4.
Is it possible to achieve the same in B4J ??
I was thinking of the encrypt and string utils for the base64 encode !?
Is it possible to achieve the same in B4J ??
I was thinking of the encrypt and string utils for the base64 encode !?
B4X:
curl --user username:password -H "Content-Type:text/xml" -i -X POST http://192.168.0.1:8080/RPC3 -o response.xml -d @tblStruct.xml
nonce=$(sed -nE 's/.*nonce="([^"]+)"/\1/p' response.xml)
hashkey=$(echo -n $nonce|base64 -d|openssl dgst -sha1 -mac HMAC -macopt hexkey:"$(echo -n u7crun6Qk4g4z0qxJRAWGA==|base64 -d|xxd -p)" -binary|base64)
curl --user username:password -H "Content-Type:text/xml" -H "X-ServiceAuthorization: $hashkey" -X POST http://192.168.0.1:8080/RPC3 -o response.xml -d @tblStruct.xml