| Home | Libraries | People | FAQ | More

##### ssl::context::use_private_key (1 of 2 overloads)

Use a private key from a memory buffer.

    void use_private_key(
        const const_buffer & private_key,
        file_format format);

This function is used to load a private key into the context from a buffer.

###### Parameters

private_key

  The buffer containing the private key.

format

  The private key format (ASN.1 or PEM).

###### Exceptions

boost::system::system_error

  Thrown on failure.

###### Remarks

Calls `SSL_CTX_use_PrivateKey` or SSL_CTX_use_PrivateKey_ASN1.