Site Tools


guides:sample_sha384_hash
// The following strBase64DocValue value is retrieved from the DOCUMENT child node of the EMBEDDED_FILE node in the XML document.
 
string strBase64DocValue = " SUkqALLnAAAtVZDKI+R4jhk…";  // Get your Base64 string from the XML doc.
 
string strBase64HashValue = getBase64Hash(strBase64DocValue);  // Use this value in your web service call
 
public static string getBase64Hash(string strB64Source)
{
Encoding u8 = Encoding.UTF8; // We use UTF8 encoding
 
byte[] b64Bytes = u8.GetBytes(strB64Source); // Put the Document B64 string into a byte array
 
byte[] b64HashBytes = SHA384.Create().ComputeHash(b64Bytes);  // Compute the SHA384 hash
 
//Convert the SHA384 hash to a Base64 string
 
string strB64Value = System.Convert.ToBase64String(b64HashBytes, 0, b64HashBytes.Length); 
 
return strB64Value;
}
guides/sample_sha384_hash.txt · Last modified: by brett.zamora