22.10.2013 Views

System i: Programming Secure Sockets APIs - IBM

System i: Programming Secure Sockets APIs - IBM

System i: Programming Secure Sockets APIs - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example<br />

The following example shows how gsk_strerror() is used.<br />

Note: By using the code examples, you agree to the terms of the “Code license and disclaimer<br />

information” on page 111.<br />

#include <br />

#include <br />

#include <br />

void main()<br />

{<br />

int rc = GSK_OK;<br />

gsk_handle env_handle = NULL;<br />

}<br />

rc = gsk_environment_open(&env_handle);<br />

if (rc != GSK_OK)<br />

{<br />

printf("gsk_environment_open() failed with rc = %d %s\n",<br />

rc,gsk_strerror(rc));<br />

break;<br />

}<br />

...<br />

API introduced: V5R1<br />

Top | UNIX-Type <strong>APIs</strong> | <strong>APIs</strong> by category<br />

i5/OS <strong>Secure</strong> <strong>Sockets</strong> Layer (SSL_) <strong>APIs</strong><br />

SSL_ <strong>APIs</strong>, when used in addition to the existing i5/OS <strong>Sockets</strong> <strong>APIs</strong>, provide the functions<br />

required for applications to establish secure communications. An application using SSL for secure<br />

communications is basically a client/server application written using sockets.<br />

i5/OS ®<br />

The SSL_ <strong>APIs</strong> are:<br />

v “QlgSSL_Init()—Initialize the Current Job for SSL (using NLS-enabled path name)” on page 65<br />

(Initialize the current job for SSL (using NLS-enabled path name)) is used to establish the SSL security<br />

information to be used for all SSL sessions for the current job.<br />

v “SSL_Create()—Enable SSL Support for the Specified Socket Descriptor” on page 69 (Enable SSL<br />

support for the specified socket descriptor) is used by a program to enable SSL support for the<br />

specified socket descriptor.<br />

v “SSL_Destroy()—End SSL Support for the Specified SSL Session” on page 71 (End SSL support for the<br />

specified SSL session) is used by a program to end SSL support for the specified SSL session.<br />

v “SSL_Handshake()—Initiate the SSL Handshake Protocol” on page 74 (Initiate the SSL handshake<br />

protocol) is used by a program to initiate the SSL handshake protocol. Both the client and the server<br />

program must call the SSL_Handshake verb in order to initiate the handshake processing.<br />

v “SSL_Init()—Initialize the Current Job for SSL” on page 80 (Initialize the current job for SSL) is used to<br />

establish the SSL security information to be used for all SSL sessions for the current job.<br />

v “SSL_Init_Application()—Initialize the Current Job for SSL Processing Based on the Application<br />

Identifier” on page 84 (Establish the SSL security information) is used to establish the SSL security<br />

information to be used for all SSL sessions for the current job based on the specified application<br />

identifier.<br />

v “SSL_Perror()—Print SSL Error Message” on page 89 (Print SSL error message) prints an error message<br />

to stderr.<br />

64 <strong>System</strong> i: <strong>Programming</strong> <strong>Secure</strong> <strong>Sockets</strong> <strong>APIs</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!