I have a secret key : zbPsRqhNg It needs to be encoded in vb.net
I am using the following source :
Friend Overrides Function PostToLender(sData As String) As String
'' sData contains the XML to post
'' lendertier.ServiceURL is the URL to post to
'' so build a checksum from the XML data
Dim Secret As String = lendertier.Credential1 '' store the secret key in the tier's 1st credential
Dim hash As HMACSHA1 = New HMACSHA1()
hash.Key = UTF8.GetBytes(Secret)
Dim checksum As String = UTF8.GetString(hash.ComputeHash(UTF8.GetBytes(sData)))
'' append checksum to URL
lendertier.ServiceURL &= "&checksum=" & checksum
'' Complete normal processing
Return MyBase.PostToLender(sData)
End Function
This is not working and the result which is not correct
checksum=%EF%BF%BD%EF%BF%BD&%EF%BF%BDg%EF%BF%BD*(%
it should be
6d91394d2b57ed448f45efcd2aeb773238b9055d
so i tryed which i think i did this wrong:
Dim Secret As String = lendertier.Credential3 '' store the secret key in the tier's 1st credential
Dim hash As New SHA1CryptoServiceProvider()
HashCore = UTF8.GetBytes(Secret)
Dim checksum As String = UTF8.GetString(hash.ComputeHash(UTF8.GetBytes(sData)))
'' append checksum to URL
lendertier.ServiceURL &= "?checksum=" & checksum
Neither work , if i could could get a little assistance that would be great.