catch the Nusoap error with php

barigain

Junior Member
Joined
Aug 23, 2012
Messages
100
Reaction score
12
The method i tried using was with openssl

PHP:
$fp = fopen($key, 'r');  //open the PEM file
$priv_key = fread($fp,8192);
fclose($fp);
$pkeyid = openssl_get_privatekey($priv_key,"password");

openssl_sign($response["data_to_sign"], $signature, $pkeyid,'sha256');

$sign = base64_encode($signature)

Is this the correct Method to generate signature for signed urls in google?
 
Not sure what you are trying to achieve but did you try using try catch blocks?

E.g.:

PHP:
try{
$fp = fopen($key, 'r');  //open the PEM file
$priv_key = fread($fp,8192);
fclose($fp);
$pkeyid = openssl_get_privatekey($priv_key,"password");

openssl_sign($response["data_to_sign"], $signature, $pkeyid,'sha256');

$sign = base64_encode($signature);
} catch (Exception $e){
echo $e->getMessage();
}
The method i tried using was with openssl

PHP:
$fp = fopen($key, 'r');  //open the PEM file
$priv_key = fread($fp,8192);
fclose($fp);
$pkeyid = openssl_get_privatekey($priv_key,"password");

openssl_sign($response["data_to_sign"], $signature, $pkeyid,'sha256');

$sign = base64_encode($signature)

Is this the correct Method to generate signature for signed urls in google?
 
Thank you for advice, but seems I generate invalid signature. There is nothing to catch..
 
Back
Top