Signature Value Calculation
{TimeStamp}{Exclusive encryption Salt} 1490714051ABCDEFGHIJKLMNOPQRSTUVWXYZ// Get the signature verification value
public string GetInvoiceSignature(string TimeStamp, string Data, string HashSalt)
{
string _hashString = string.Format("{0}{1}", TimeStamp, HashSalt);
return SHA256Encrypt(_hashString);
}
// Using SHA256 encryption
public string SHA256Encrypt(string NonEncryptString)
{
SHA256 sha256 = new SHA256CryptoServiceProvider();//Building SHA256
byte[] source = Encoding.ASCII.GetBytes(NonEncryptString);//String to Byte[]
byte[] crypto = sha256.ComputeHash(source);//Encryption with SHA256
string result = BitConverter.ToString(crypto).Replace("-", string.Empty);//Change the encrypted string from Byte [] to string
return result;//Output the result
}Last updated