Essential Networking Module User’s Guide
PART I Overview of the Essential Networking Module
Chapter 1 Introduction
1.1 Welcome
1.2 Examples
1.3 Products and Services Information
Chapter 2 Basic Concepts
2.1 Product Definition
2.2 Operation
2.2.1 A Simple Code Example
2.2.2 A Comparative Code Example
2.3 Key Abstractions
2.3.1 About Portals
2.3.1.1 RWSocketPortal
2.3.1.2 RWPortal as a Base
2.3.2 About Sockets
2.3.2.1 RWSocket
2.3.2.2 RWSocketListener
2.4 Relationship to Other Modules
2.4.1 Essential Networking and SourcePro Net
2.4.2 Essential Networking and the SourcePro C++ Product Line
Chapter 3 Product Organization
3.1 Classes
3.1.1 Header Files
3.2 Architecture
3.2.1 Foundation
3.2.2 Communication Adapters Layer
3.2.3 Portal Layer
3.2.4 Communication Services Layer
3.3 Class Hierarchies
PART II The Networking Package
Chapter 4 Portals
4.1 Using Portals to Write Client Programs
4.2 Writing a Simple Client
4.3 Handling Errors
4.4 Reading From a Portal
4.5 Understanding the Portal and Implementation Classes
4.6 Using Channel-specific Portal Classes
Chapter 5 Streams
5.1 Using Iostreams
5.1.1 Using Iostream Classes for Formatted Output
5.1.2 Using Iostream Classes for Formatted Input
5.2 Understanding the Architecture of a Portal Stream
5.3 Understanding Virtual Streams
5.4 Using Virtual Streams
5.4.1 Constructing a Portable ASCII Virtual Stream for Output
5.4.2 Constructing a Binary Virtual Stream for Input from a Portal
5.4.3 Creating Chains of Objects
Chapter 6 Socket Addresses
6.1 Introduction
6.1.1 The Socket Address Classes
6.1.2 Understanding the Base Class
6.2 Controlling Network Access
6.3 Printing Socket Addresses
6.4 Using Generic Socket Addresses
6.4.1 Constructing Generic Addresses
6.4.2 Understanding How RWSockAddr Is Implemented
6.5 Using Internet Addresses
6.5.1 Constructing a Host
6.5.2 Building Internet Addresses
6.6 Using IPv6 Addresses
6.6.1 Constructing a Host
6.6.2 Building IPv6 Addresses
6.7 Using Socket Types
6.7.1 Understanding Socket Types
6.7.2 Representing a Socket Type
Chapter 7 The Berkeley Sockets Adapter
7.1 Introduction
7.2 Using RWSocket
7.3 Closing Sockets and Avoiding Resource Leaks
7.4 Using Socket Portals
7.5 Using Communication Services with Sockets
7.6 Socket Multiplexing
7.6.1 Working with Socket Attributes
7.6.2 Using rwSocketSelect
7.7 Examples
Chapter 8 The Windows Socket Adapter
8.1 Introduction
8.2 Initializing and Cleaning Up
8.3 Using the Networking Package in Global Objects
Chapter 9 Servers
9.1 Introduction
9.2 A Simple Synchronous Server
9.3 Socket Listeners
9.4 Complex Servers
Appendix A Glossary
Appendix B Examples
B.1 Networking Package
Internet Protocols Module User’s Guide
PART I Overview of the Internet Protocols Module
Chapter 1 Introduction
1.1 Welcome
1.2 Packages in the Internet Protocols Module
1.3 Examples
1.4 Products and Services Information
Chapter 2 Product Overview
2.1 Introduction
2.2 Definitions
2.3 Architecture
2.3.1 Reference-counting and the Handle-Body Implementation
2.3.2 Protocol Command Sequence
2.4 Multithreading and IOUs
2.4.1 RWTIOUResult
2.4.2 RWTIOUResult Callbacks
2.4.3 RWTIOUResult Polling
2.4.4 A Common Multithreading Mistake
PART II Packages of the Internet Protocols Module
Chapter 3 The Internet Basics Package
3.1 Introduction
3.1.1 Classes in the Internet Basics Package
3.1.2 Header Files
3.2 Internet Basics Class Hierarchy
3.3 About RWDirEntry
3.4 About Protocol Replies
3.5 About RWStreamCoupler
3.6 About RWURL
Chapter 4 The FTP Package
4.1 Introduction
4.1.1 Classes in the FTP Package
4.1.2 Header Files
4.2 FTP Class Hierarchy
4.3 About FTP Protocol Replies
4.4 Using Active and Passive Clients
4.5 Sending Generic Protocol Commands
4.6 File Retrieval: Using the FTP Agent (Part I)
4.7 File Retrieval: Using the FTP Agent (Part II)
4.8 FTP Command Demo: Using the FTP Client
Chapter 5 The HTTP Package
5.1 Introduction
5.1.1 Classes in the HTTP Package
5.1.2 Header Files
5.2 HTTP Class Hierarchies
5.3 Using the HTTP Classes
5.3.1 Connecting to the Server
5.3.2 Creating a Request
5.3.3 Sending a Request
5.3.4 Retrieving a Reply
5.3.5 Interpreting the Reply
5.3.6 Bringing it All Together
5.4 Advanced Topics
5.4.1 Additional HTTP Methods
5.4.2 Specifying a Custom Message-Body Handler
5.4.3 Downloading Part of a Document
5.4.4 Adding and Removing Headers
5.4.5 Adding a Maximum Wait to Requests
5.4.6 Sending Requests through HTTP Proxies
5.4.7 Persistent Connections and Pipelined Requests
5.4.8 HTTP and International Documents
Chapter 6 The POP3 Package
6.1 Introduction
6.1.1 Classes in the POP3 Package
6.1.2 Header Files
6.2 POP3 Class Hierarchy
6.3 About Protocol Replies
6.4 Saving a Mail Message to a File
6.5 Checking for the End of a Mail Message
6.6 Mail Retrieval: Using the POP3 Client
Chapter 7 The SMTP Package
7.1 Introduction
7.1.1 Classes in the SMTP Package
7.1.2 Header Files
7.2 SMTP Class Hierarchy
7.3 About Protocol Replies
7.4 Closing the Mail Transfer Session
7.5 Mail Sender: Using the SMTP Agent
Chapter 8 The MIME Package
8.1 Introduction
8.1.1 Classes in the MIME Package
8.1.2 Header Files
8.1.3 Relationship to Transport Protocols
8.1.4 Approach to Validating Messages
8.2 MIME Class Hierarchy
8.3 MIME Basics
8.3.1 Part and Message
8.3.2 Part Structure
8.3.3 MIME Headers
8.3.4 Part Body
8.4 The MIME Package Representation of a Message
Chapter 9 Using the MIME Package
9.1 Preparing Data
9.1.1 Create an RWCString
9.1.2 Convert Text to Canonical Form
9.1.3 Encode the Data
9.2 Creating a Simple MIME Part
9.2.1 Create Headers for the Part
9.2.2 Create an RWMimePart
9.2.3 Add the Headers to the Part
9.2.4 Add the String to the Part
9.2.5 Create a MIME String
9.3 Program: Creating a Simple MIME Message
9.4 Creating a Multipart MIME Part
9.4.1 Create Parts
9.4.2 Create Headers for a Multipart
9.4.3 Create an RWMimeMultipart
9.4.4 Add Each Part
9.4.5 Add Headers to the Part
9.4.6 Create a MIME String
9.5 Program: Creating a Multipart MIME Message
9.6 Processing a MIME Part
9.6.1 Receive the Part as a String
9.6.2 Create a MIME Part
9.6.3 Fill the MIME Part From the String
9.6.4 Retrieve the Headers as Necessary
9.6.5 Process the Body
9.6.5.1 Simple MIME Parts
9.6.5.2 Multipart MIME Parts
9.7 Program: Processing a Simple MIME Message
9.8 Program: Processing a Multipart MIME Message
9.9 Advanced Example
Chapter 10 MIME Package Advanced Topics
10.1 Using the MIME Headers Effectively
10.1.1 The MIME-Version Header
10.1.2 The Content-Type Header
10.1.3 The Content-Transfer-Encoding Header
10.1.4 The Content-ID Header
10.1.5 The Content-Description Header
10.1.6 The Content-Location Header
10.1.7 The Content-Disposition Header
10.1.8 Part Body
10.2 Constructing MIME Part Bodies
10.2.1 Canonical Form
10.2.2 Multipart Bodies
10.3 Transfer Encodings
10.3.1 Identity Encodings
10.3.2 Base 64 Encoding
10.3.3 Quoted-Printable Encoding
10.4 MIME and Internationalized Messages
PART III Resources
Appendix A Examples
A.1 Introduction
A.2 FTP Package
A.3 HTTP Package
A.4 MIME Package
A.5 POP3 Package
A.6 SMTP Package
Secure Communication Module User’s Guide
PART I Overview of the Secure Communication Module
Chapter 1 Introduction
1.1 What Is the Secure Communication Module?
1.2 Packages in the Secure Communication Module
1.3 Module-Specific Software Requirements
1.3.1 Cryptographic Library Dependency
1.3.2 Installing the Packages
1.4 Assumptions
1.5 Examples
1.6 Products and Services Information
Chapter 2 Product Overview
2.1 Understanding Secure Communication
2.2 The Secure Sockets Package
2.3 The HTTPS Package
2.4 Concepts
PART II Secure Sockets Package
Chapter 3 Overview of the Secure Sockets Package
3.1 Introduction
3.1.1 Classes in the Secure Sockets Package
3.1.2 Header Files
3.2 Secure Sockets Package Class Hierarchy
Chapter 4 Using Secure Sockets
4.1 Getting Started with Secure Sockets
4.1.1 Writing a Client Program That Uses RWSecureSocket
4.1.2 Writing a Client Program That Uses RWSecureSocketPortal
4.1.3 Writing a Server Program That Uses RWSecureSocket
4.1.4 Writing a Server Program That Uses RWSecureSocketPortal
4.1.5 About the Keys and Certificates in the Example Programs
4.2 Developing Secure Applications
4.2.1 Writing New Secure Sockets Applications
4.2.2 Porting Existing Networking Package Applications to the Secure Sockets Package
4.3 Obtaining Certificates
4.3.1 Obtaining Trusted Certificates to Verify Other Certificates
4.3.2 Obtaining Certificates to Identify a Specific Entity
4.3.3 Using Hard-Coded Keys and Certificates
4.4 Initializing the Secure Sockets Package
4.4.1 Seeding the Random Number Generator
4.4.2 Global Objects and the Secure Sockets Package Initialization
4.5 Creating the Secure Socket Context
4.5.1 Initializing the Context to Perform Server Authentication Only
4.5.2 Initializing the Context to Perform Both Client and Server Authentication
4.6 Constructing a Certificate
4.7 Checking the Validity of a Certificate
4.8 Using RWSecureSocket, RWSecureSocketPortal, and RWSecureSocketListener
Chapter 5 Advanced Topics
5.1 Using RWPortalIStream and RWPortalOstream
5.2 Using RWAsymmetricKey
5.3 Using Encrypted Keys
5.4 Handling Exceptions
5.5 Using the Secure Sockets Callbacks
5.5.1 Password Callback
5.5.2 Certificate Verification Callback
5.5.3 Handshake Information Callback
5.5.4 Client Certificate Callback
5.6 Reusing Sessions
5.7 Implementing Both Client and Server Authentication
5.7.1 Client Example
5.7.2 Server Example
5.8 Mixing Calls to the Secure Sockets Package with Calls to the Cryptographic Library
5.9 Building the Secure Sockets Package as a Shared Library
5.10 Handling Errors from the Cryptographic Library
5.11 Secure Socket Multiplexing
5.11.1 Working with Secure Socket Attributes
5.11.2 Using RWSecureSocketAttribute
5.11.3 Using rwSecureSocketSelect
5.12 Multithreading, the Handle-Body Idiom, and the Secure Sockets Package
5.13 Security Issues
PART III HTTPS Package
Chapter 6 Overview of the HTTPS Package
6.1 Introduction
6.1.1 Classes in the HTTPS package
6.1.2 Header Files
6.2 HTTPS Package Class Hierarchy
Chapter 7 Using HTTPS
7.1 Getting Started with HTTPS
7.1.1 Using RWHttpAgent to Retrieve a Document Securely
7.1.2 Using RWHttpsSecureSocketClient to Retrieve a Document
7.2 Developing HTTPS Applications
7.3 Connecting Through a Proxy
7.4 Using the Security Callbacks
7.4.1 Certificate Name Check Callback
7.4.2 Certificate Name Mismatch Callback
Chapter 8 Callbacks
8.1 Supplying Your Own Callbacks
8.1.1 Writing a Callback
8.1.2 Switching to the Default Callback
8.2 Using the HTTP CONNECT Method with the HTTPS Package
PART IV FTPS Package
Chapter 9 Overview of the FTPS Package
9.1 Introduction
9.1.1 Classes in the FTPS Package
9.1.2 Header Files
9.2 FTPS Package Class Hierarchy
Chapter 10 Using FTPS
10.1 Developing an FTPS Application
10.2 About FTPS Protocol Replies
10.3 Using the FTPS Package
PART V Resources
Appendix A RWSocket & RWSecureSocket
A.1 Functions That Do Not Appear in the Secure Sockets Package
A.2 Functions That Are Deprecated
Appendix B Bibliography
B.1 Introduction
B.2 References
Essential Networking Module User’s Guide
B.2 References