By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,275 Members | 2,008 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,275 IT Pros & Developers. It's quick & easy.

Signature generation with

P: 1
my program is developed by 2005. and i need to call web API using VB.Net 2005 and it has to generate Signature. i'm generated signature but API retern Invalid Signature Error. sample signature code with PHP. here is the sample code. and how can i generate Signature using this example. really thanks for your help

1. Concatenate (order values based on the alphabetical order of the parameter names) all values to single string.

Expand|Select|Wrap|Line Numbers
  1. $dataString ​=​$amount​. ​$apiToken​.​$UserId​.​$requestId​;
2. Sign data string using RSA signing algorithm. Hashing algorithm is SHA256.

Expand|Select|Wrap|Line Numbers
  1. $pkeyid ​= openssl_pkey_get_private(​"file:///private_key".pem"​)​; $signResult ​= openssl_sign(​$dataString​, ​$signature​, ​$pkeyid​, ​OPENSSL_ALGO_SHA256 ​ )​;
3. Base64 encodes the generated signature

Expand|Select|Wrap|Line Numbers
  1. $signature ​= base64_encode(​$signature​)​; 

3 Weeks Ago #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.