title: Is it possible to use json key instead of p12 key for service account credentials?
body: <p>I am using "Google.Apis.Bigquery.v2 Client Library" with C#.</p>
  
  <p>I am authorizing to Google BigQuery using "Service Account" (see <a href="http://www.afterlogic.com/mailbee-net/docs/OAuth2GoogleServiceAccounts.html">http://www.afterlogic.com/mailbee-net/docs/OAuth2GoogleServiceAccounts.html</a>). To create the X509 certificate I use the p12 key from the Google Developers Console. However, right now the json key is the default. Can I use it instead the p12 key?</p>
  
  <p>I have the following code:</p>
  
  <pre><code>    string serviceAccountEmail = "xxxx@developer.gserviceaccount.com";
  
  X509Certificate2 certificate;
  using (Stream stream = new FileStream(@"C:\key.p12", FileMode.Open, FileAccess.Read, FileShare.Read))
  {
      using (MemoryStream ms = new MemoryStream())
      {
          stream.CopyTo(ms);
          certificate = new X509Certificate2(ms.ToArray(), "notasecret", X509KeyStorageFlags.Exportable);
      }
  }
  
  // Create credentials
  ServiceAccountCredential credential = new ServiceAccountCredential(
      new ServiceAccountCredential.Initializer(serviceAccountEmail)
      {
          Scopes = new[] {
          BigqueryService.Scope.Bigquery,
          BigqueryService.Scope.CloudPlatform,
      },
      }.FromCertificate(certificate));
  
  // Create the service
  BaseClientService.Initializer initializer = new BaseClientService.Initializer()
  {
      HttpClientInitializer = credential,
      ApplicationName = "My Application",
      GZipEnabled = true,
  };
  
  BigqueryService service = new BigqueryService(initializer);
  var projects = service.Projects.List().Execute();
  </code></pre>