title: Which part of the private key for service accounts in Google Cloud Platform do I actually use?
body: <p>I am trying to verify I have the <code>private_key</code> correct as described in <a href="https://stackoverflow.com/questions/58566667/how-to-write-data-to-firebase-cloud-firestore-using-google-apps-script?noredirect=1#comment103453196_58566667">this SO question</a>.</p>
  
  <p><a href="https://cloud.google.com/iam/docs/creating-managing-service-account-keys" rel="nofollow noreferrer">Docs about service account private keys are here.</a></p>
  
  <pre><code>{
  "type": "service_account",
  "project_id": "[PROJECT-ID]",
  "private_key_id": "[KEY-ID]",
  "private_key": "-----BEGIN PRIVATE KEY-----\n[PRIVATE-KEY]\n-----END PRIVATE KEY-----\n",
  "client_email": "[SERVICE-ACCOUNT-EMAIL]",
  "client_id": "[CLIENT-ID]",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://accounts.google.com/o/oauth2/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/[SERVICE-ACCOUNT-EMAIL]"
  }
  </code></pre>
  
  <p>When using <code>private_key</code>, do I just get the part in between the</p>
  
  <pre><code>-----BEGIN PRIVATE KEY-----\n
  </code></pre>
  
  <p>string and the</p>
  
  <pre><code>\n-----END PRIVATE KEY-----\n
  </code></pre>
  
  <p>In other words, the <code>[PRIVATE-KEY]</code> shown in the example?</p>
  
  <p>Or do I get the entire string including the two "bookend" strings shown above?</p>
  
  <p>Also, within the <code>[PRIVATE-KEY]</code> string, there are several occurrences of the <code>\n</code> substring. Do I remove them or leave them in?</p>