code: public <T extends AbstractGoogleJsonClient.Builder> T fromServiceAccount(T builder,
        String serviceAccountId, File p12File) throws GeneralSecurityException, IOException {
      Preconditions.checkNotNull(builder);
      GoogleCredential creds = new GoogleCredential.Builder()
          .setTransport(httpTransport)
          .setJsonFactory(jsonFactory)
          .setServiceAccountId(serviceAccountId)
          .setServiceAccountScopes(scopes)
          .setServiceAccountPrivateKeyFromP12File(p12File)
          .build();
      creds.refreshToken();
      return prepareBuilder(builder, creds, null);
    }
docs: Prepare an AbstractGoogleJsonClient.Builder with the given service account ID
  and private key {@link File}.
  
  @param builder The builder to be prepared.
  @param serviceAccountId The service account ID (typically an email address)
  @param p12File The file on disk containing the private key
  @return The passed in builder, for easy chaining.
  @throws GeneralSecurityException
  @throws IOException