I\'m working on integrating my application with the Walmart Marketplace API. Their documentation pretty much says if you don\'t use Java you\'re on your own. My application
it works for me using c# .net 4.6
using System;
using System.Security.Cryptography;
public static string SignData(string stringToBeSigned, string encodedPrivateKey)
{
string signedData = string.Empty;
try
{
var decodeKey = Convert.FromBase64String(privateEncodedStr);
var key = CngKey.Import(decodeKey, CngKeyBlobFormat.Pkcs8PrivateBlob);
var alg = new RSACng(key);
byte[] data = Encoding.UTF8.GetBytes(stringToBeSigned);
byte[] signData = alg.SignData(data, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
signedData = Convert.ToBase64String(signData);
}
catch (Exception)
{
throw;
}
return signedData;
}