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

RWAsymmetricKey

Module:  Secure Communication Module   Package:  Secure Sockets


RWAsymmetricKeyRWHandleBase

Local Index

Members

Header File

#include <rw/secsock/RWAsymmetricKey.h>

Description

RWAsymmetricKey encapsulates the underlying cryptographic library's representation of the asymmetric key. Public and private keys are identical in structure. Typedefs from RWAsymmetricKey to RWPublicKey and RWPrivateKey are provided.

RWAsymmetricKey uses the handle-body idiom to take over memory management from the cryptographic library.

The handle-body implementation of RWAsymmetricKey enables you to pass handles by value with the same cost as passing a class by pointer or reference. This implementation also ensures that the body and the associated memory are not destroyed until all handles referring to that body are destroyed.

RWAsymmetricKey's constructors throw an RWUnableToReadPrivateKeyError exception if the data is not in PEM format. They also throw RWSecureSocketNoCallbackSpecifiedError if your application passes an encrypted key, but does not name a password callback.

Other errors, including invalid key data, are detected only when the key is used in other functions. For this reason, you should validate keys by calling RWSecureSocketContext::checkPrivateKey() after assigning a certificate and private key to a context object.


NOTE -- For a full discussion of the handle-body idiom, see Section 7.3.1, "Understanding the Handle-Body Idiom," in the Threads Module User's Guide.

Typedefs

Public Constructors

RWAsymmetricKey(const char** pubKeyData, 
  int numLines, RWPasswordCallback cb = 0);
RWAsymmetricKey(istream& is, RWPasswordCallback cb = 0);
RWAsymmetricKey(const RWAssymmetricKey& second);

Public Destructor

~RWAsymmetricKey();

Public Operator

RWAsymmetricKey&
operator=(const RWAsymmetricKey& second);

Public Member Function

RWAsymmetricKeyRep
getRep() const;

NOTE -- The memory that the returned pointer references is owned by the body class, RWAsymmetricKeyImp, so users should not attempt to delete it. RWAsymmetricKeyImp deletes the memory when all handles referring to that body are destroyed.


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.