public class GoogleMapsUrlSigner extends Object
GoogleMapsUrlSigner can sign urls with the private key. This class is inspired
from this
class| Constructor and Description |
|---|
GoogleMapsUrlSigner() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
convertToKeyByteArray(String yourGooglePrivateKeyString)
Converts the given private key as String to an base 64 encoded byte array.
|
static String |
signRequest(String yourGooglePrivateKeyString,
String path,
String query)
Returns the context path with the signature as parameter.
|
static String |
signRequest(URL url,
String yourGooglePrivateKeyString)
Returns the full url as String object with the signature as parameter.
|
public static byte[] convertToKeyByteArray(String yourGooglePrivateKeyString)
yourGooglePrivateKeyString - the google private key as Stringpublic static String signRequest(String yourGooglePrivateKeyString, String path, String query) throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException, URISyntaxException
yourGooglePrivateKeyString - your private key from google as byte array in Base64 formatpath - the pathquery - the queryNoSuchAlgorithmException - the no such algorithm exceptionInvalidKeyException - the invalid key exceptionUnsupportedEncodingException - the unsupported encoding exceptionURISyntaxException - the URI syntax exceptionpublic static String signRequest(URL url, String yourGooglePrivateKeyString) throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException, URISyntaxException
url - the urlyourGooglePrivateKeyString - the your google private key stringNoSuchAlgorithmException - the no such algorithm exceptionInvalidKeyException - the invalid key exceptionUnsupportedEncodingException - the unsupported encoding exceptionURISyntaxException - the URI syntax exceptionCopyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.