---
sourceDocument: Australia Conversational Interfaces
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/pt-BR/conversational-interfaces

 Release :

    - australia

ft:locale :

    - pt-BR

ft:publication_title :

    - Australia Conversational Interfaces

ft:clusterId :

    - convint

bundleId :

    - convint

workflow :

    - Platform


---

# Generate a Java Keystore file from the JSON private key file

# Generate a Java Keystore file from the JSON private key file {#ariaid-title1}

* Versão de lançamento: Australia
* 
* Atualizado 12 de mar. de 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 min. de leitura

To use Google Dialogflow with Virtual Agent
Bot Interconnect, the third step is to generate a JKS file from the JSON
private key you created in the previous step.

## Antes de Iniciar

Role required: admin

## Procedimento

1. In a text editor, open the JSON private key file you downloaded in the previous procedure.
2. Copy the private key text, starting with the BEGIN PRIVATE KEY section and ending with the END PRIVATE KEY section.  
3. Remove the line return characters (\\n) from the key:
   1. Paste the key text in a text editor, such as TextEdit or Notepad.
   2. Click EditFindFind \& Replace or EditReplace.
   3. In the Find field, type <kbd class="ph userinput">\n</kbd>.
   4. In the Replace field, press <kbd class="ph userinput">Ctrl + Enter</kbd> or <kbd class="ph userinput">Alt + Enter</kbd>.
   5. Click Replace All.

   {#generate-jks-from-json-dialogflow__substeps_qq5_fvy_3sb}  
   The key text will be formatted with line breaks.
4. Save the formatted private key text as a .pem file.  
   For example, privatekey.pem.
5. In a web browser, open the URL that is listed in the JSON file for the client_x509_cert_url parameter.  
   For example, https://www.googleapis.com/robot/v1/metadata/x509/my-srvc-account%40my-agent-ukpy.iam.gserviceaccount.com. The certificates page opens.
6. Copy the certificate that has the same private key ID that appears in the JSON file.
7. Replace \\n with line breaks in the certificate, as described in step 3.
8. Save the formatted certificate as a .pem file.  
   For example, certificate.pem.
9. Navigate to the folder that contains both the private key and certificate files.
10. Open a terminal window:
    1. In Mac OS, right-click or ctrl-click the folder and select New terminal at folder.
    2. In Windows, right-click the folder and select Open in terminal.
    {#generate-jks-from-json-dialogflow__substeps_owm_jrj_fwb}
11. At the terminal's command prompt, create the JKS file as follows:
    1. Enter the following command:  
       <kbd class="ph userinput">openssl pkcs12 -export -in [certificate file name] -inkey [private key file name] -certfile [certificate file name] -out testkeystore.p12</kbd>

       For example, if certificate.pem is the name of the certficate and
       privatekey.pem is the name of the private key:

       <kbd class="ph userinput">openssl pkcs12 -export -in certificate.pem -inkey privatekey.pem -certfile certificate.pem -out testkeystore.p12</kbd>
    2. When prompted for a password, enter the password of your choice using a minimum of six characters.  
       A PKCS 12 file is created with the name
       testkeystore.p12.
    3. Enter the following command:  
       <kbd class="ph userinput">keytool -importkeystore -srckeystore testkeystore.p12 -srcstoretype pkcs12 -destkeystore dialogflow.jks -deststoretype JKS</kbd>

       You will be prompted for a password multiple times. Use the same
       password you created in the previous step.
    {#generate-jks-from-json-dialogflow__substeps_lv1_jcf_jsb}

## Resultado

A JKS file is created.
**Tópico anterior:** [Create a service account and private key for the Google Dialogflow project](https://servicenow-prod.fluidtopics.net/vypGDIJPUvkag2uaDSQEXg "To use Google Dialogflow with Virtual Agent Bot Interconnect, the second step is to create a service account and private key for the new agent in Google Dialogflow.")  
**Próximo tópico:** [Configure connections to Google Dialogflow in your Virtual Agent Bot Interconnect instance](https://servicenow-prod.fluidtopics.net/fQ~GveXQzWkFjkUVFZGn3A "To use Google Dialogflow with Virtual Agent Bot Interconnect, the fourth step is to configure the connection in your ServiceNow instance.")

