I am using a *.p12 (private key) File to connect to my google analytics data as follows.
GoogleCredential credential = new GoogleCredential.Builder()
.setTransport(httpTransport)
.setJsonFactory(jsonFactory)
.setServiceAccountId(serviceAccountMail)
.setServiceAccountPrivateKeyFromP12File(new File(getRequest().getServletContext().getRealPath(keyFileLocation),keyFile))
.setServiceAccountScopes(AnalyticsScopes.all()).build();
This is in a gwtp application which I built using below options:
clean install -Dstrict -Denvironment=dev -Denv.applicationProfile=dev -DskipTests=true
When I deploy the code to Tomcat, it gets corrupted or becomes invalid. See the below screenshot:
In logs, I can also find this error:
DerInputStream.getLength(): lengthTag=111, too big.
I would appreciate any advice on how to work this around.