PKey.ReadFromContainer
----------------------

Reads a key from a container value.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Certificates](component_Certificates.md) | [11.4](newinversion114.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "PKey.ReadFromContainer"; Container { ; Password } ) 

**MBS**( **"PKey.ReadFromContainer";** /\* Reads a key from a container value. \*/  
**$Container**; /\* The container with the PEM file. \*/   
**$Password**) /\* Optional; For encrypted private keys, the password to use.e.g. "test" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Container | The container with the PEM file. |  |  |
| Password | For encrypted private keys, the password to use. | "test" | Optional |

### Result

Returns PKey reference number or error.

### Description

Reads a key from a container value.  
Format can be either text PEM format or binary DER format.  
### See also

- [PKCS12.ReadFromContainer](PKCS12ReadFromContainer.md)
- [PKCS7.ReadFromContainer](PKCS7ReadFromContainer.md)
- [PKey.Read](PKeyRead.md)
- [X509.ReadFromContainer](X509ReadFromContainer.md)

### Release notes

- **Version 11.4**
    - Added [PKey.Read](https://www.mbsplugins.eu/PKeyRead.shtml), [PKey.ReadFromContainer](https://www.mbsplugins.eu/PKeyReadFromContainer.shtml) and [PKey.ReadFromFile](https://www.mbsplugins.eu/PKeyReadFromFile.shtml) functions.

### Blog Entries

- [New in MBS FileMaker Plugin 11.4](https://www.mbsplugins.de/archive/2021-09-15/New_in_MBS_FileMaker_Plugin_11/monkeybreadsoftware_blog_filemaker)
- [Neues MBS FileMaker Plugin 11.4](https://www.mbsplugins.de/archive/2021-09-07/Neues_MBS_FileMaker_Plugin_114/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 11.4 - More than 6500 Functions In One Plugin](https://www.mbsplugins.de/archive/2021-09-07/MBS_FileMaker_Plugin_114_-_Mor/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.4pr3](https://www.mbsplugins.de/archive/2021-08-25/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 22nd August 2021 , last changed 3th March 2025

  
[PKey.Read](PKeyRead.md) - [PKey.ReadFromFile](PKeyReadFromFile.md)

[HTML Version](PKeyReadFromContainer.shtml)