Issue 857 in google-api-java-client: setServiceAccountPrivateKeyFromP12File(InputStream p12File)

72 views
Skip to first unread message

google-api-...@googlecode.com

unread,
Feb 12, 2014, 2:28:56 AM2/12/14
to google-api-jav...@googlegroups.com
Status: New
Owner: ngmic...@google.com

New issue 857 by sebastie...@progis.fr:
setServiceAccountPrivateKeyFromP12File(InputStream p12File)
http://code.google.com/p/google-api-java-client/issues/detail?id=857

For now, you can't use a p12 stored as a resource and it coul be very
usefull if you can setServiceAccountPrivateKeyFromP12File from an
InputStream (way that you can access to the ressource).

Here is the method that I use :
public Builder setServiceAccountPrivateKeyFromP12File(InputStream
p12File)
throws GeneralSecurityException, IOException {
serviceAccountPrivateKey =
SecurityUtils.loadPrivateKeyFromKeyStore(
SecurityUtils.getPkcs12KeyStore(), p12File, "notasecret",
"privatekey", "notasecret");
return this;
}

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

google-api-...@googlecode.com

unread,
Feb 24, 2015, 4:23:48 AM2/24/15
to google-api-jav...@googlegroups.com

Comment #1 on issue 857 by benoit.s...@gmail.com:
setServiceAccountPrivateKeyFromP12File(InputStream p12File)
https://code.google.com/p/google-api-java-client/issues/detail?id=857

I found another way to use your P12 as a resource on StackOverflow (works
on AppEngine): http://stackoverflow.com/a/18621932/2611083.

This method gives you a "PrivateKey" object and then you just have to use
it with "setServiceAccountPrivateKey(PrivateKey serviceAccountPrivateKey)".

google-api-...@googlecode.com

unread,
Feb 24, 2015, 4:24:49 AM2/24/15
to google-api-jav...@googlegroups.com

Comment #2 on issue 857 by benoit.s...@gmail.com:
setServiceAccountPrivateKeyFromP12File(InputStream p12File)
https://code.google.com/p/google-api-java-client/issues/detail?id=857

I found another way to use your P12 as a resource on StackOverflow (works
on AppEngine): http://stackoverflow.com/a/24945108/2611083.
Reply all
Reply to author
Forward
0 new messages