WvStreams
Public Types | Public Member Functions | Public Attributes | List of all members
WvRSAKey Class Reference

An RSA public key or public/private key pair that can be used for encryption. More...

#include <wvrsa.h>

Public Types

enum  DumpMode { RsaPEM , RsaPubPEM , RsaHex , RsaPubHex }
 Type for the encode() and decode() methods. More...
 

Public Member Functions

 WvRSAKey (const WvRSAKey &k)
 
 WvRSAKey (WvStringParm keystr, bool priv)
 
 WvRSAKey (struct rsa_st *_rsa, bool priv)
 
 WvRSAKey (int bits)
 Create a new RSA key of bits strength.
 
virtual bool isok () const
 
virtual WvString encode (const DumpMode mode) const
 Return the information requested by mode.
 
virtual void encode (const DumpMode mode, WvBuf &buf) const
 
virtual void decode (const DumpMode mode, WvStringParm encoded)
 Load the information from the format requested by mode into the class - this overwrites the certificate.
 
virtual void decode (const DumpMode mode, WvBuf &encoded)
 

Public Attributes

struct rsa_st * rsa
 

Detailed Description

An RSA public key or public/private key pair that can be used for encryption.

Knows how to encode/decode itself into a string of hex digits for easy transport.

See also
WvRSAEncoder

Definition at line 26 of file wvrsa.h.

Member Enumeration Documentation

◆ DumpMode

Type for the encode() and decode() methods.

RsaPEM = PEM Encoded RSA Private Key RsaPubPEM = PEM Encoded RSA Public Key RsaHex = DER Encoded RSA Private Key in hexified form RsaPubHex = DER Encoded RSA Public Key in hexified form

Definition at line 36 of file wvrsa.h.

Constructor & Destructor Documentation

◆ WvRSAKey() [1/5]

WvRSAKey::WvRSAKey ( )

Definition at line 17 of file wvrsa.cc.

◆ WvRSAKey() [2/5]

WvRSAKey::WvRSAKey ( const WvRSAKey k)

Definition at line 24 of file wvrsa.cc.

◆ WvRSAKey() [3/5]

WvRSAKey::WvRSAKey ( WvStringParm  keystr,
bool  priv 
)

Definition at line 51 of file wvrsa.cc.

◆ WvRSAKey() [4/5]

WvRSAKey::WvRSAKey ( struct rsa_st *  _rsa,
bool  priv 
)

Definition at line 36 of file wvrsa.cc.

◆ WvRSAKey() [5/5]

WvRSAKey::WvRSAKey ( int  bits)

Create a new RSA key of bits strength.

Definition at line 65 of file wvrsa.cc.

◆ ~WvRSAKey()

WvRSAKey::~WvRSAKey ( )
virtual

Definition at line 73 of file wvrsa.cc.

Member Function Documentation

◆ isok()

bool WvRSAKey::isok ( ) const
virtual

Definition at line 80 of file wvrsa.cc.

◆ encode() [1/2]

WvString WvRSAKey::encode ( const DumpMode  mode) const
virtual

Return the information requested by mode.

Definition at line 86 of file wvrsa.cc.

References encode().

Referenced by encode(), and WvX509Mgr::test().

◆ encode() [2/2]

void WvRSAKey::encode ( const DumpMode  mode,
WvBuf &  buf 
) const
virtual

Definition at line 95 of file wvrsa.cc.

◆ decode() [1/2]

void WvRSAKey::decode ( const DumpMode  mode,
WvStringParm  encoded 
)
virtual

Load the information from the format requested by mode into the class - this overwrites the certificate.

Definition at line 147 of file wvrsa.cc.

References decode().

Referenced by decode().

◆ decode() [2/2]

void WvRSAKey::decode ( const DumpMode  mode,
WvBuf &  encoded 
)
virtual

Definition at line 158 of file wvrsa.cc.

Member Data Documentation

◆ rsa

struct rsa_st* WvRSAKey::rsa

Definition at line 38 of file wvrsa.h.


The documentation for this class was generated from the following files: