I am using the newer version of PubSub - Publisher API
I have a P12 file and am building the credential like this:
GoogleCredential credential = new GoogleCredential.Builder()
.setTransport(transport)
.setJsonFactory(JSON_FACTORY)
.setServiceAccountId(serviceAccount)
.setServiceAccountScopes(Arrays.asList("https://www.googleapis.com/auth/pubsub"))
.setServiceAccountPrivateKeyFromP12File(new File(keyFile))
.build();
How do I set the credentials on the Publisher?
Also, is there a way to get the static scope string "https://www.googleapis.com/auth/pubsub"