Public Sub HMACSHA512(key As String, input As String, key_is_hex_string As Boolean) As String
Dim no As NativeObject = Me
Dim keyb() As Byte
Dim bc As ByteConverter
If key_is_hex_string Then
keyb = bc.HexToBytes(key)
Else
keyb = key.GetBytes("UTF8")
End If
Dim res As Object = no.RunMethod("hmacForKeyAndData::", Array(no.ArrayToNSData(keyb), no.ArrayToNSData(input.GetBytes("utf8"))))
Dim resb() As Byte = no.NSDataToArray(res)
Return bc.HexFromBytes(resb).ToLowerCase
End Sub