Hi,
trying to use the HMAC support from the library and running into an error I can't figure out. Any help would be great. My function:
Function HMAC(msg As String) As String
hmac = CreateObject("roHMAC")
privateKey = CreateObject("roByteArray")
privateKey.fromBase64String("k3U6GLkZOoNIoSgjDshPErvqMIFdE0xMTx8kgsrhnC0=")
result = hmac.setup("sha1", privateKey)
print "result";result
if result = 0
message = CreateObject("roByteArray")
message.fromAsciiString(msg)
result = hmac.process(message)
return result.toBase64String()
end if
End Function
and the resultant error:
Current Function:
274: Function HMAC(msg As String) As String
275: hmac = CreateObject("roHMAC")
276: privateKey = CreateObject("roByteArray")
277: privateKey.fromBase64String("k3U6GLkZOoNIoSgjDshPErvqMIFdE0xMTx8kgsrhnC0=")
278: result = hmac.setup("sha1", privateKey)
279: print "result";result
280: if result = 0
281: message = CreateObject("roByteArray")
282: message.fromAsciiString(msg)
283: result = hmac.process(message)
284: return result.toBase64String()
285: end if
286: End Function
/tmp/plugin/DEAAAAeOkGv7/pkg:/source/appMain.brs(278): runtime error ec: 'Dot' Operator attempted with invalid BrightScript Component or interface reference.
278: result = hmac.setup("sha1", privateKey)
I still have little experience with the platform so I could be missing something obvious but that makes no sense to me unless setup is not a method on the object.
thanks,
Jonny