Why does encrypting HMAC-SHA1 in exactly the same code in C# and PowerShell show different results? Why does encrypting HMAC-SHA1 in exactly the same code in C# and PowerShell show different results? powershell powershell

Why does encrypting HMAC-SHA1 in exactly the same code in C# and PowerShell show different results?


It's because the escape character in PowerShell is ` while the one in C# is \.

$str = "PUT`n`napplication/x-zip-compressed`nThu, 09 Feb 2017 08:59:43 GMT`n/test-bucket/test-key"

Should yield the expected result.