# Dynamic Loading

**API Group:** `xmlsec_core_dl`

Dynamic loading of XML Security crypto back-ends.

Dynamic crypto-engine library loading functions.

## Functions

### `xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms`

```c
int xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms(xmlSecCryptoDLFunctionsPtr functions);
```

*Source:* [include/xmlsec/dl.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/dl.h#L38)

Registers key data and transforms from the crypto back-end.

Registers the key data and transforms provided by the crypto back-end. 

**Parameters:**

- `functions` — the functions table.


**Returns:** 0 on success or a negative value if an error occurs.

---

### `xmlSecCryptoDLInit`

```c
int xmlSecCryptoDLInit(void);
```

*Source:* [include/xmlsec/dl.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/dl.h#L48)

Initializes the dynamic library loading engine.

Initializes dynamic loading engine. This is an internal function and should not be called by application directly. 

**Returns:** 0 on success or a negative value if an error occurs.

---

### `xmlSecCryptoDLShutdown`

```c
int xmlSecCryptoDLShutdown(void);
```

*Source:* [include/xmlsec/dl.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/dl.h#L49)

Shuts down the dynamic library loading engine.

Shutdowns dynamic loading engine. This is an internal function and should not be called by application directly. 

**Returns:** 0 on success or a negative value if an error occurs.

---

### `xmlSecCryptoDLLoadLibrary`

```c
int xmlSecCryptoDLLoadLibrary(const xmlChar *crypto);
```

*Source:* [include/xmlsec/dl.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/dl.h#L51)

Loads a crypto library.

Loads the xmlsec-$crypto library. This function is NOT thread safe, application MUST NOT call `xmlSecCryptoDLLoadLibrary`, `xmlSecCryptoDLGetLibraryFunctions`, and `xmlSecCryptoDLUnloadLibrary` functions from multiple threads. 

**Parameters:**

- `crypto` — the desired crypto library name ("openssl", "nss", ...). If NULL then the default crypto engine will be used.


**Returns:** 0 on success or a negative value if an error occurs.

---

### `xmlSecCryptoDLGetLibraryFunctions`

```c
xmlSecCryptoDLFunctionsPtr xmlSecCryptoDLGetLibraryFunctions(const xmlChar *crypto);
```

*Source:* [include/xmlsec/dl.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/dl.h#L52)

Loads a crypto library and returns its function table.

Loads the xmlsec-$crypto library and gets global crypto functions/transforms/keys data/keys store table. This function is NOT thread safe, application MUST NOT call `xmlSecCryptoDLLoadLibrary`, `xmlSecCryptoDLGetLibraryFunctions`, and `xmlSecCryptoDLUnloadLibrary` functions from multiple threads. 

**Parameters:**

- `crypto` — the desired crypto library name ("openssl", "nss", ...).


**Returns:** the table or NULL if an error occurs.

---

### `xmlSecCryptoDLUnloadLibrary`

```c
int xmlSecCryptoDLUnloadLibrary(const xmlChar *crypto);
```

*Source:* [include/xmlsec/dl.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/dl.h#L53)

Unloads a crypto library.

Unloads the xmlsec-$crypto library. All pointers to this library functions tables became invalid. This function is NOT thread safe, application MUST NOT call `xmlSecCryptoDLLoadLibrary`, `xmlSecCryptoDLGetLibraryFunctions`, and `xmlSecCryptoDLUnloadLibrary` functions from multiple threads. 

**Parameters:**

- `crypto` — the desired crypto library name ("openssl", "nss", ...).


**Returns:** 0 on success or a negative value if an error occurs.

---

### `xmlSecCryptoDLSetFunctions`

```c
int xmlSecCryptoDLSetFunctions(xmlSecCryptoDLFunctionsPtr functions);
```

*Source:* [include/xmlsec/dl.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/dl.h#L55)

Sets global crypto function table.

Sets global crypto functions/transforms/keys data/keys store table. 

**Parameters:**

- `functions` — the new table


**Returns:** 0 on success or a negative value if an error occurs.

---

### `xmlSecCryptoDLGetFunctions`

```c
xmlSecCryptoDLFunctionsPtr xmlSecCryptoDLGetFunctions(void);
```

*Source:* [include/xmlsec/dl.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/dl.h#L56)

Gets global crypto function table.

Gets global crypto functions/transforms/keys data/keys store table. 

**Returns:** the table.

---
