#include <tls.h>
Collaboration diagram for TLS:

Sample code illustrating the use of this class appears in the Cookbook section Implementing a Simple TLS Client.
Public Member Functions | |
Constructor | |
| TLS () | |
| Constructor. | |
Object Reuse and Initialization | |
| void | clear () |
| Reset TLS object. | |
| int | setcipher (int cipher, int minor) |
| Specify cipher suite and minor TLS version number. | |
| void | setrand (const str &r1, const str &r2, const str &r3, double now) |
| Seed pseudorandom number generation. | |
| int | load (const Chain &a) |
| Load chain of certificates for client authentication. | |
Inspectors | |
| str | version () const |
| Get current TLS version number. | |
| int | parse (str &rec, str &rest) const |
| Extract top-level record from server buffer. | |
Communications Processing Functions | |
| int | dorecs () |
| Process communication records between client and server. | |
Encryption and Decryption | |
| str | wrap (str data) |
| Encrypt data buffer (with MAC). | |
| int | unwrap (str data, str &plain) |
| Dencrypt data buffer (and strip MAC). | |
Predicates | |
| bool | isBad () const |
| Predicate to test object's error state. | |
Data Fields | |
| party | c |
| client | |
| party | s |
| server | |
| str | dn |
| list of CA DNs accepted by server for client authentication | |
| int | lasterror |
| explanation of last non-zero return code | |
| TokenSignCallback | sign |
| callback for client authentication via token | |
| void * | tokeninfoptr |
| additional data for signature callback | |
| int dorecs | ( | ) |
Process communication records between client and server.
| int load | ( | const Chain & | a | ) |
Load chain of certificates for client authentication.
| a | chain of certificates to be loaded |
Extract top-level record from server buffer.
| rec | buffer in which to place the top-level record (prior to unwrapping) | |
| rest | buffer in which to place the remaining data from the server buffer |
| int setcipher | ( | int | cipher, | |
| int | minor | |||
| ) |
Specify cipher suite and minor TLS version number.
| cipher | ID of desired cipher suite:
| |
| minor | TLS version number |
Seed pseudorandom number generation.
| r1 | 46-byte seed (for premaster secret) | |
| r2 | 28-byte seed (for client portion of master secret) | |
| r3 | extra 20-byte seed (for client authentication using DSA or ECDSA) | |
| now | current time (provides additional entropy for client portion of master secret) |
Dencrypt data buffer (and strip MAC).
| data | buffer to be decrypted | |
| plain | output buffer for plaintext |
| str version | ( | ) | const [inline] |
Get current TLS version number.
Encrypt data buffer (with MAC).
| data | buffer to be encrypted |
| ISC Cryptographic Development Kit - User's Guide | |
| Questions? E-mail ISC technical support | |
| Copyright© 2002-2006 Information Security Corp. All rights reserved. |