***

title: getKey
slug: /reference/typescript/agents/configuration/ssl-config/get-key
description: Read the PEM private key file from disk.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Read the PEM private key file from disk.

## **Parameters**

None.

## **Returns**

`string | null` -- The key file contents, or `null` if the file path is not
set or the file does not exist.

## **Example**

```typescript {4}
import { SslConfig } from '@signalwire/sdk';

const ssl = new SslConfig({ certPath: './cert.pem', keyPath: './key.pem' });
const key = ssl.getKey();
console.log(key ? 'Key loaded' : 'Key not found');
```