# OpenSSL Keys Store

**API Group:** `xmlsec_openssl_keysstore`

OpenSSL-specific key store implementation.

OpenSSL keys store that uses Simple Keys Store under the hood.

## Macros

### `xmlSecOpenSSLKeysStoreId`

*Defined as:* `xmlSecOpenSSLKeysStoreGetKlass()`

*Source:* [include/xmlsec/openssl/keysstore.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/openssl/keysstore.h#L26)

A OpenSSL keys store klass id.

---

## Functions

### `xmlSecOpenSSLKeysStoreGetKlass`

```c
xmlSecKeyStoreId xmlSecOpenSSLKeysStoreGetKlass(void);
```

*Source:* [include/xmlsec/openssl/keysstore.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/openssl/keysstore.h#L27)

The OpenSSL list based keys store klass.

**Returns:** OpenSSL list based keys store klass.

---

### `xmlSecOpenSSLKeysStoreAdoptKey`

```c
int xmlSecOpenSSLKeysStoreAdoptKey(xmlSecKeyStorePtr store, xmlSecKeyPtr key);
```

*Source:* [include/xmlsec/openssl/keysstore.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/openssl/keysstore.h#L29)

Adds `key` to the `store`.

**Parameters:**

- `store` — the pointer to OpenSSL keys store.
- `key` — the pointer to key.


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

---

### `xmlSecOpenSSLKeysStoreLoad`

```c
int xmlSecOpenSSLKeysStoreLoad(xmlSecKeyStorePtr store, const char *uri, xmlSecKeysMngrPtr keysMngr);
```

*Source:* [include/xmlsec/openssl/keysstore.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/openssl/keysstore.h#L31)

Reads keys from an XML file.

**Parameters:**

- `store` — the pointer to OpenSSL keys store.
- `uri` — the filename.
- `keysMngr` — the pointer to associated keys manager.


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

---

### `xmlSecOpenSSLKeysStoreSave`

```c
int xmlSecOpenSSLKeysStoreSave(xmlSecKeyStorePtr store, const char *filename, xmlSecKeyDataType type);
```

*Source:* [include/xmlsec/openssl/keysstore.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/openssl/keysstore.h#L34)

Writes keys from `store` to an XML file.

**Parameters:**

- `store` — the pointer to OpenSSL keys store.
- `filename` — the filename.
- `type` — the saved keys type (public, private, ...).


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

---
