1
真的希望有人能夠幫助我在這裏。 我在vb.net中製作了一個小程序,它將與我最近部署的Cloudstack進行交互。cloudstack api與視覺基本簽名
當時我的API直接以401未授權方式拒絕,所以我顯然沒有正確生成我的簽名。
我拉從中說明了如何生成簽名請求籤名的文件的位......你可以查看這裏:http://www.x85.co.uk/generatesig.txt
我用一個例子功能我在網上找到獲得SHA1哈希值,但遠不在此代碼它有密鑰,那麼這就是一個問題...
Function getSHA1Hash(ByVal strToHash As String) As String
Dim sha1Obj As New Security.Cryptography.SHA1CryptoServiceProvider
Dim bytesToHash() As Byte = System.Text.Encoding.ASCII.GetBytes(strToHash)
bytesToHash = sha1Obj.ComputeHash(bytesToHash)
Dim strResult As String = ""
For Each b As Byte In bytesToHash
strResult += b.ToString("x2")
Next
Return strResult
End Function
我也還沒有包含在URL編碼位因爲我不知道如何做到這一點。
任何幫助appriciated。
謝謝你們!