Generate URL signature for Google Static Maps

0

I need an app to generate URL's with a signature at the end based on a "URL signature secret" and the URL itself, according to what is established by Google Maps Static API in the following link:

link

I have written the following code, from which signatures are obtained, but which do not exactly match those generated by a tool that is in the Google API's user console, and which would be good

I should get:
yFkqfJN-NQm_FCjr91Sq027bSbE =

And I get:
2TYVVn3 + DPYvA42HWvOdPQhYadc =

I'm doing the app in Basic4Android

Could someone tell me what's wrong? Thank you very much.

Code:

Dim m As Mac
Dim k As KeyGenerator
Dim strUt As StringUtils
Dim st As String

k.Initialize("HMACSHA1")
k.KeyFromBytes("Aquí,  la clave o secreto de firma".GetBytes("UTF8"))
m.Initialise("HMACSHA1", k.Key)
m.Update("Aquí, la URL sin firmar".GetBytes("UTF8"))
Dim b() As Byte
b = m.Sign
st = strUt.EncodeBase64(b)
Log(st)
    
asked by Interlnk 29.11.2017 в 15:26
source

0 answers