> For the complete documentation index, see [llms.txt](https://help.security.gallagher.com/knowledge-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.security.gallagher.com/knowledge-hub/configuration-client/site-installation/services-and-workstations/creating-a-rest-api-client-item/creating-the-client-certificate.md).

# Creating the Client Certificate

When using a Windows operating system, PowerShell can be used to create the client certificate.

Perform the following procedure to create the client certificate, and then add Network Service permission to the certificate.

### Why use a Client Certificate?

Using a client certificate for REST connections to the Command Centre Server increases security. It means the Command Centre Server will only accept incoming REST connections that can provide a client certificate whose thumbprint matches the Client Certificate Thumbprint assigned to a configured REST Client item.

A client certificate is stored on a client machine. After creating the client certificate, you get its unique thumbprint and assign it to a REST Client item on the Command Centre Server. Now, that REST Client item will only accept incoming connections from the machine(s) that can provide its matching API Key and also have the client certificate that matches its assigned thumbprint.

#### Creating the certificate

1. Open the Run command by pressing \<![](https://3000903572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfCvaxj3suxNBzdwQndVT%2Fuploads%2Fgit-blob-d86e2711c2cf89c86c515a85376aa36a40533077%2Fwindows_logo.png?alt=media)+ **R** > on the client machine that will be connecting to the REST API.

   The Run command window displays.
2. Type ‘PowerShell’ and press < **Enter** >.

   The Windows PowerShell displays.

   **Note:** You may need to run PowerShell as an Administrator.
3. Enter the following command:

   `New-SelfSignedCertificate -certstorelocation cert:\currentuser\my -dnsname [Certificate-Name]`

   *Example:*

   `New-SelfSignedCertificate -certstorelocation cert:\currentuser\my -dnsname GallagherRestClientCert`

   **Certificate name:** Give your certificate a recognisable yet unique name (dnsname) so that it can easily be found later, while its purpose is also distinguishable from other REST Client Certificates potentially installed on the same machine. For example, if a site required a REST Client item for the Gallagher Cardholder Sync feature, the certificate could be named 'GallagherRESTClientCert\_CardholderSync'.

   **Note:** This script creates the certificate in the **Current User** > **Personal** > **Certificates** store. If the service making a REST connection will not be able to access the certificate there (e.g. the service is run as 'LocalSystem'), you should create the certificate in the **Local Computer** > **Personal** > **Certificates** store. Replace `'cert:\currentuser\my'` with `'cert:\localmachine\my'` and run PowerShell as the same user that the service runs as.

   ![](https://3000903572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfCvaxj3suxNBzdwQndVT%2Fuploads%2Fgit-blob-988d87e4bd3d4b253d1e8d674f856d10ce2bd9fc%2Frestclient_powershell.png?alt=media)

   The above example creates the certificate “GallagherRestClientCert” in the **Current User** > **Personal** > **Certificate store**.
4. Copy the Thumbprint.

   The Thumbprint will be used in the [Creating a REST API Client Item](https://help.security.gallagher.com/knowledge-hub/configuration-client/site-installation/services-and-workstations/creating-a-rest-api-client-item.md) procedure.

   **Note:** The certificate’s thumbprint can be viewed in the ‘Details’ tab of the Certificate file.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.security.gallagher.com/knowledge-hub/configuration-client/site-installation/services-and-workstations/creating-a-rest-api-client-item/creating-the-client-certificate.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
