gtpc1m6eTransmission Control Protocol/Internet Protocol

SSL_use_RSAPrivateKey_file

The SSL_use_RSAPrivateKey_file function loads the Rivest-Shamir-Adelman (RSA) private key for use with a Secure Sockets Layer (SSL) session.

Format

#include <openssl/ssl.h>
int SSL_use_RSAPrivateKey_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 RSA private key. The maximum length is 255 characters.

type
The file type, which is one of the following:

SSL_FILETYPE_ASN1
The file is in abstract syntax notation 1 (ASN.1) format.

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_RSAPrivateKey_file function, you must identify the password for the private key file, if the file is in PEM (base64 coded) format, 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