467,910 Members | 1,641 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,910 developers. It's quick & easy.

Signature generation with VB.net

my program is developed by Vb.net 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​)​; 

Thanks
Feb 1 '20 #1
  • viewed: 1902
Share:

Post your reply

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

Similar topics

51 posts views Thread by Mudge | last post: by
1 post views Thread by Josť MarŪa Mateos | last post: by
8 posts views Thread by Max M | last post: by
reply views Thread by Rasmus Fogh | last post: by
15 posts views Thread by Kannan Goundan | last post: by
11 posts views Thread by Marco Loskamp | last post: by
1 post views Thread by PaulJB PHD | last post: by
reply views Thread by dawid.greyvenstein | last post: by
3 posts views Thread by Thomas Guettler | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.