Java42 / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

Support PEM file format as input format for service accounts #649

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
External references, such as a standards document, or specification?

http://javadoc.google-api-java-client.googlecode.com/hg/1.12.0-beta/com/google/a
pi/client/googleapis/auth/oauth2/GoogleCredential.Builder.html#setServiceAccount
PrivateKeyFromP12File(java.io.File)

Java environments (e.g. Java 6, Android 2.3, App Engine, or All)?

All

Please describe the feature requested.

We should add a utility method, something like 
setServiceAccountPrivateKeyFromPemFile.

To get the PEM file, take the p12 file generated by the APIs Console and 
convert it to a PEM like so:

openssl pkcs12 -in xxxxx-privatekey.p12 -nodes -nocerts > secret.pem

When prompted for a password, enter "notasecret".

Original issue reported on code.google.com by yan...@google.com on 2 Nov 2012 at 5:29

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 16 Nov 2012 at 1:38

GoogleCodeExporter commented 9 years ago
Oauth end implemented here: https://codereview.appspot.com/6843063/#ps3001
Just need to add the method in GoogleCredential

Original comment by ngmic...@google.com on 4 Dec 2012 at 3:23

GoogleCodeExporter commented 9 years ago
Finished here: https://codereview.appspot.com/6866054/

Original comment by ngmic...@google.com on 7 Dec 2012 at 10:12