Hi all,
I'm trying to use the KRAKEN-API but can't connect. I used RemoRoth subs (IOS) https://www.b4x.com/android/forum/threads/kraken-api.90473/ but since I use B4J I had to modify the HMACSHA512. Maybe my mistake is in this version. Could anyone tell me if it is correct? Thanks.
I'm trying to use the KRAKEN-API but can't connect. I used RemoRoth subs (IOS) https://www.b4x.com/android/forum/threads/kraken-api.90473/ but since I use B4J I had to modify the HMACSHA512. Maybe my mistake is in this version. Could anyone tell me if it is correct? Thanks.
IOS HMACSHA512:
Public Sub HMACSHA512(keyb() As Byte, inputb() As Byte) As Byte()
Dim no As NativeObject = Me
Dim res As Object = no.RunMethod("hmacForKeyAndData512::", Array(no.ArrayToNSData(keyb), no.ArrayToNSData(inputb)))
Dim resb() As Byte = no.NSDataToArray(res)
Return resb
End Sub
B4J HMACSHA512:
Private Sub HMACSHA512(keyb() As Byte, inputb() As Byte) As Byte()
Dim m As Mac
Dim k As KeyGenerator
k.Initialize("HMACSHA512")
k.KeyFromBytes(keyb)
m.Initialise("HMACSHA512", k.Key)
m.Update(inputb)
Dim b() As Byte
b = m.Sign
Return b
End Sub