Hello
In b4j I can use encryption lib of b4a without any problem but with b4i when I add encryption library of b4a to use this :
my keyvaluestore module gives error.
How can I fix this because it works perfect with b4j
In b4j I can use encryption lib of b4a without any problem but with b4i when I add encryption library of b4a to use this :
B4X:
Sub HashHmac(data As String, secret As String) As Byte()
Try
Dim m As Mac 'm As Message Authentication Code
Dim kg As KeyGenerator 'kg As KeyGenerator
kg.Initialize("HmacSHA512") 'initialize kg using HmacSHA512 algorithm
kg.KeyFromBytes(secret.GetBytes("UTF8")) 'encode string "secret" to an array of Bytes using UTF8
m.Initialise("HmacSHA512", kg.Key) 'initialize m using HmacSHA512 algorithm and the secret key
m.Update(data.GetBytes("UTF8")) 'encodes post data to an array of Bytes and loads it to be signed
Return m.Sign
Catch
Log(LastException)
End Try
'sign the loaded data using the secret key, return the calc signature data
End Sub
my keyvaluestore module gives error.
B4X:
Error description: Missing parameter.
Error occurred on line: 56
Return ser.ConvertBytesToObject(cipher.Decrypt(b, Password))
Word: )
How can I fix this because it works perfect with b4j