# LoadCertificateFromDirectory Method

## Overloads

| [LoadCertificateFromDirectory(String, String)](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.CertificateManager.LoadCertificateFromDirectory.htm#Qlik_Engine_Communication_CertificateManager_LoadCertificateFromDirectory_System_String_System_String_) |  | Loads the Qlik Sense certificate used for direct connections from a folder. |
| --- | --- | --- |
| [LoadCertificateFromDirectory(String, SecureString)](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.CertificateManager.LoadCertificateFromDirectory.htm#Qlik_Engine_Communication_CertificateManager_LoadCertificateFromDirectory_System_String_System_Security_SecureString_) |  | Loads the Qlik Sense certificate used for direct connections from a folder. |

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.CertificateManager.LoadCertificateFromDirectory.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.CertificateManager.LoadCertificateFromDirectory.htm)

## LoadCertificateFromDirectory(String, String)

Loads the Qlik Sense certificate used for direct connections from a folder.

### Declaration

```

          public static X509Certificate2Collection LoadCertificateFromDirectory(string path, string certificatePassword)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.String | path | The path to the folder containing the certificates. |
| System.String | certificatePassword | The password to use when reading the certificate. |

### Returns

| Type | Description |
| --- | --- |
| System.Security.Cryptography.X509Certificates.X509Certificate2Collection | A certificate collection containing the Qlik Sense client certificate. |

### Exceptions

| Type | Condition |
| --- | --- |
| System.IO.DirectoryNotFoundException | Thrown if argument directory is not found. |
| System.IO.FileNotFoundException | Thrown if argument directory does not contain a client certificate file. |

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.CertificateManager.LoadCertificateFromDirectory.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.CertificateManager.LoadCertificateFromDirectory.htm)

## LoadCertificateFromDirectory(String, SecureString)

Loads the Qlik Sense certificate used for direct connections from a folder.

### Declaration

```

          public static X509Certificate2Collection LoadCertificateFromDirectory(string path, SecureString certificatePassword = null)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.String | path | The path to the folder containing the certificates. |
| System.Security.SecureString | certificatePassword | The password to use when reading the certificate. |

### Returns

| Type | Description |
| --- | --- |
| System.Security.Cryptography.X509Certificates.X509Certificate2Collection | A certificate collection containing the Qlik Sense client certificate. |

### Exceptions

| Type | Condition |
| --- | --- |
| System.IO.DirectoryNotFoundException | Thrown if argument directory is not found. |
| System.IO.FileNotFoundException | Thrown if argument directory does not contain a client certificate file. |