Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Secure Communication Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWSecureSocket

Module:  Secure Communication Module   Package:  Secure Sockets


Does not inherit

Local Index

Members

Header File

#include <rw/secsock/RWSecureSocket.h>

Description

RWSecureSocket is an abstraction of a TCP socket using the SSL/TLS protocols for secure communication. It was designed to operate similarly to the non-secure RWSocket class.

Enum

enum RWSSLShutdownMode 
{ RW_SSL_SHUTDOWN_NORMAL, RW_SSL_SHUTDOWN_QUIET };

Typedef

Public Constructors

RWSecureSocket();
RWSecureSocket(const RWSecureSocket& context);
RWSecureSocket(const RWSecureSocketContext& context);
RWSecureSocket(const RWSecureSocketContext& context,
                const RWSecureSocketSession& session);

Destructor

~RWSecureSocket();

Public Operators

RWSecureSocket&
operator=(const RWSecureSocket& second);
bool
operator==(const RWSecureSocket& s) const;
bool
operator<(const RWSecureSocket& s) const;

Public Member Functions

RWSecureSocket
accept(RWSockAddr *addr =0) const;
void
bind(const RWSockAddrBase& address);
void
bind(const RWSockAddrBase& address, 
      const RWSecureSocketContext& context);
bool
checkPrivateKey() const;
void
close();
void
closesocket();
void
connect(const RWSockAddrBase& addr);
void
connect(const RWSockAddrBase& addr, 
        const RWSecureSocketContext& context);
void
connect(const RWSockAddrBase& addr,
        const RWSecureSocketSession& session);
void
connect(const RWSockAddrBase& addr,
        const RWSecureSocketSession& session,
        const RWSecureSocketContext& context);
RWX509Certificate
getCertificate() const;
RWSecureSocketConnectionRep
getConnection() const;
RWSecureSocketContext
getContext() const;
RWInfoCallback 
getInfoCallback() const;
RWX509Certificate
getPeerCertificate() const;
RWSockAddr
getpeername() const;
RWSecureSocketSession
getSession() const;
RWSSLShutdownMode 
getShutdownMode() const;
SOCKET
getSocket() const;
RWSockAddr
getsockname() const;
void
getsockopt(int level, int option, void *optval,
           RWSockLenType *optlen) const;
int
getsockopt(int option) const;
RWSockType
getsocktype() const;
RWCString
id(unsigned level=0) const;
void
ioctl(long cmd, void *arg) const;
void
ioctl(long cmd, int arg) const;
int
ioctl(long cmd) const;
void
ioctlsocket(long cmd, void *arg) const;
void
ioctlsocket(long cmd, int arg) const;
int
ioctlsocket(long cmd) const;
bool
isValid() const;
Checks if the socket is ready for use. Returns true if ready, false if otherwise.void
listen(int backlog=5) const;
void
listen(const RWSockAddrBase& addr, int backlog=5);
void
listen(const RWSockAddrBase& addr,
       const RWSecureSocketContext& context, int backlog=5);
RWNetBuf
recv(int flags=0) const;
int
recv(char *buf, int len, int flags=0,
     RWNetBuf::State* s=0) const;
RWNetBuf
recvAtLeast(int n) const;
int
recvAtLeast(char *buf, int len, int n,
            RWNetBuf::State* s=0) const;
int
send(const RWCString& buf) const;
int
send(const char *buf, int len) const;
void
sendAtLeast(const RWCString& buf) const;
int
sendAtLeast(const RWCString& buf, int n) const;
void
sendAtLeast(const char* buf, int len) const;
int
sendAtLeast(const char* buf, int bufLen, int min) const;
void
setCertificate(const RWX509Certificate& cert);

NOTE -- If the setCertificate() function is called before setPrivateKey(), the cryptographic library automatically compares the key and the certificate. If the key does not match the certificate, setPrivateKey() throws RWSecureSocketUsePrivateKeyError. This exception is not thrown if setPrivateKey() is called before setCertificate(), even if the key does not match the certificate. In any case, if the key does not match the certificate, checkPrivateKey() returns false.
void
setCertificateVerifyMode(int mode);
void
setContext(const RWSecureSocketContext& context);
void
setIdentity(const RWX509Certificate& cert,
            const RWPrivateKey& pkey);
void
setInfoCallback(RWInfoCallback fun);
void
setPrivateKey(const RWPrivateKey& pkey);

NOTE -- If the setCertificate() function is called before setPrivateKey(), the cryptographic library automatically compares the key and the certificate. If the key does not match the certificate, setPrivateKey() throws RWSecureSocketUsePrivateKeyError. This exception is not thrown if setPrivateKey() is called before setCertificate(), even if the key does not match the certificate. In any case, if the key does not match the certificate, checkPrivateKey() returns false.
void
setSession(const RWSecureSocketSession& session);
void 
setShutdownMode(RWSSLShutdownMode mode);

NOTE -- Security issues related to this function are described in the Security Issues section of the Secure Communication Module User's Guide.
void
setsockopt(int level, int option, void *optval, 
           int optlen) const;

void
setsockopt(int option, int optval) const;
void
shutdown() const;


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.