为什么下面的PowerShell脚本会这样做:
$privateKey = "843c1f887b"
$requestData = "1543448572|d.lastname@firm.com|Firstname Lastname"
function signRequest {
$hmacsha = New-Object System.Security.Cryptography.HMACSHA256
$hmacsha.key = [Text.Encoding]::ASCII.GetBytes($privateKey)
$signature = $hmacsha.ComputeHash([Text.Encoding]::ASCII.GetBytes($requestData))
$signature = [Convert]::ToBase64String($signature)
$outi = $signature
return $signature
}
转换为哈希值:
FipK51tOtzb2m2yFQAf5IK6BNthClnqE24luMzYMPuo=
和其他在线HMAC SHA256生成器使用相同的输入:
162a4ae75b4eb736f69b6c854007f920ae8136d842967a84db896e33360c3eea
你有没有对脚本中我做错的地方提出任何建议?谢谢!