27.12.2012 Views

HP Open Source Security for OpenVMS Volume 2: HP SSL for ...

HP Open Source Security for OpenVMS Volume 2: HP SSL for ...

HP Open Source Security for OpenVMS Volume 2: HP SSL for ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4 <strong>SSL</strong> Programming Concepts<br />

<strong>SSL</strong> Programming Concepts<br />

<strong>HP</strong> <strong>SSL</strong> Data Structures<br />

This chapter discusses how to write application programs using <strong>HP</strong> <strong>SSL</strong> on <strong>Open</strong>VMS. The <strong>SSL</strong> library<br />

provides APIs supporting three <strong>SSL</strong> protocols: <strong>SSL</strong> Version 2 (<strong>SSL</strong>v2), <strong>SSL</strong> Version 3 (<strong>SSL</strong>v3), and TLS<br />

Version 1 (TLSv1). You can write an <strong>HP</strong> <strong>SSL</strong> application program in C or C++.<br />

This chapter provides the following in<strong>for</strong>mation:<br />

A description of the seven <strong>HP</strong> <strong>SSL</strong> data structures<br />

How to configure and obtain certificates<br />

An <strong>HP</strong> <strong>SSL</strong> programming tutorial that shows the implementation of a simple <strong>HP</strong> <strong>SSL</strong> client and server<br />

program using <strong>HP</strong> <strong>SSL</strong> APIs<br />

4.1 <strong>HP</strong> <strong>SSL</strong> Data Structures<br />

Be<strong>for</strong>e you start <strong>SSL</strong> application development, you should understand the data structures used <strong>for</strong> <strong>SSL</strong> APIs,<br />

and the relationships between the data structures.<br />

<strong>SSL</strong> APIs use data structures to hold various types of in<strong>for</strong>mation about <strong>SSL</strong> sessions and connections. The<br />

most important structures are <strong>SSL</strong>_CTX and <strong>SSL</strong>. Usually, one <strong>SSL</strong>_CTX structure exists per <strong>SSL</strong> application<br />

program, and an <strong>SSL</strong> structure is created every time a new <strong>SSL</strong> connection is created. An <strong>SSL</strong> structure<br />

inherits configuration in<strong>for</strong>mation from the <strong>SSL</strong>_CTX structure when it is created.<br />

Table 4-1 shows the APIs commonly used <strong>for</strong> creating and deallocating data structures.<br />

Table 4-1 APIs <strong>for</strong> Data Structure Creation and Deallocation<br />

Data Structure API <strong>for</strong> Creation API <strong>for</strong> Deallocation<br />

<strong>SSL</strong>_CTX <strong>SSL</strong>_CTX_new() <strong>SSL</strong>_CTX_free()<br />

<strong>SSL</strong> <strong>SSL</strong>_new() <strong>SSL</strong>_free()<br />

<strong>SSL</strong>_SESSION <strong>SSL</strong>_SESSION_new() <strong>SSL</strong>_SESSION_free()<br />

BIO BIO_new() BIO_free()<br />

X509 X509_new() X509_free()<br />

RSA RSA_new() RSA_free()<br />

DH DH_new() DH_free()<br />

51

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

Saved successfully!

Ooh no, something went wrong!