gtpc1m6dTransmission Control Protocol/Internet Protocol

SSL_use_PrivateKey_file

The SSL_use_PrivateKey_file function loads the private key for use with a Secure Sockets Layer (SSL) session.

Format

#include <openssl/ssl.h>
int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type)

ssl
A pointer to a token returned on the SSL_new call.

file
A pointer to the name of the file that contains the private key. The maximum length is 255 characters.

type
The type of file, which must be the following:

SSL_FILETYPE_PEM
The file is in PEM (base64 encoded) format.

Normal Return

Return code 1 indicates that the function was successful.

Error Return

A return code equal to 0 indicates an error. The following are the most likely causes of errors:

Programming Considerations

Before calling the SSL_use_PrivateKey_file function, you must identify the password for the private key file by issuing the SSL_CTX_set_default_passwd_cb_userdata function. Do this only if the private key file has been encrypted.

Examples

For sample SSL applications, go to http://www.ibm.com/tpf/pubs/tpfpubs.htm, click SSL for the TPF 4.1 System: An Online User's Guide, and click Examples from the left navigation bar.

Related Information