Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cSecureKnock Class Reference

#include <cSecureChannel.h>

Inheritance diagram for GrayLib::cSecureKnock:
GrayLib::cSecureId

Public Types

enum  CIPHER_TYPE {
  CIPHER_None = 0 , CIPHER_RC4 , CIPHER_Blowfish , CIPHER_AES ,
  CIPHER_QTY , CIPHER_KEY_RSA = 31
}
 
typedef cSecureId SUPER_t
 

Public Member Functions

 cSecureKnock (cStringA sAppId="", cStringA sUserId="", WORD nCryptAbilities=_1BITMASK(CIPHER_RC4)|_1BITMASK(CIPHER_None))
 
HRESULT Serialize (cArchive &a)
 
HRESULT SetSecureKnock (cStreamInput &s)
 
HRESULT SetSecureKnock (const void *pData, size_t nSize)
 
void SetClear () noexcept
 
bool IsSame (const cSecureKnock &k) const
 
- Public Member Functions inherited from GrayLib::cSecureId
 cSecureId (cStringA sAppId="", cStringA sUserId="") noexcept
 
bool IsSame (const cSecureId &k) const
 

Public Attributes

FOURCC m_nSignature
 const cSecureKnock::k_SIGNATURE to declare my protocol More...
 
WORD m_nVersion
 const _INC_cSecureChannel_H = my protocol version id More...
 
WORD m_nCryptAbilities
 Am i limited in my crypt abilities ? mask of CIPHER_TYPE. CIPHER_KEY_RSA. More...
 
- Public Attributes inherited from GrayLib::cSecureId
cStringA m_sAppId
 The clients declared Purpose/Application in talking to the server. e.g. "Browser", "GameClient", "PatchClient", etc. More...
 
cStringA m_sUserId
 The clients User/Account/InstanceId name it wants to login with. derives security privilege level from this login. More...
 

Static Public Attributes

static const FOURCC k_SIGNATURE = ((DWORD)(BYTE)( 'G' ) | ((DWORD)(BYTE)( 'S' ) << 8) | ((DWORD)(BYTE)( 'e' ) << 16) | ((DWORD)(BYTE)( 'c' ) << 24 ))
 sent by client as an opening signature. More...
 
static const size_t k_SizeMin = 14
 min size in bytes for this serialized message. 8 + 6. More...
 

Detailed Description

The first message sent from client to server. Serialize this. knock=hello

Member Typedef Documentation

◆ SUPER_t

Member Enumeration Documentation

◆ CIPHER_TYPE

can be used with _1BITMASK() for m_nCryptAbilities

Enumerator
CIPHER_None 

cCipherNone = for _DEBUG so utilities like WireShark can see my data stream.

CIPHER_RC4 

cCipherRC4. Worst cipher. but has no block size/padding. Try not to use this ?

CIPHER_Blowfish 

cCipherBlowfish has block alignment size. needs padding.

CIPHER_AES 

cCipherAES. Best but has block alignment size. needs padding.

CIPHER_QTY 
CIPHER_KEY_RSA 

i will/may try to log in using an RSA public key. please send it to me.

Constructor & Destructor Documentation

◆ cSecureKnock()

GrayLib::cSecureKnock::cSecureKnock ( cStringA  sAppId = "",
cStringA  sUserId = "",
WORD  nCryptAbilities = _1BITMASK(CIPHER_RC4) | _1BITMASK(CIPHER_None) 
)
inline

Member Function Documentation

◆ IsSame()

bool GrayLib::cSecureKnock::IsSame ( const cSecureKnock k) const

◆ Serialize()

HRESULT GrayLib::cSecureKnock::Serialize ( cArchive a)

Send or Receive the knock serialized message.

Returns
<0 = error HRESULT_WIN32_C(ERROR_IO_INCOMPLETE)

◆ SetClear()

void GrayLib::cSecureKnock::SetClear ( )
inlinenoexcept

◆ SetSecureKnock() [1/2]

HRESULT GrayLib::cSecureKnock::SetSecureKnock ( const void *  pData,
size_t  nSize 
)

Read a knock message from pData if i can.

Returns
length of the data consumed. HRESULT_WIN32_C(ERROR_IO_INCOMPLETE) = incomplete but not fatal.

◆ SetSecureKnock() [2/2]

HRESULT GrayLib::cSecureKnock::SetSecureKnock ( cStreamInput s)

Read a knock message from cStreamInput.

Returns
HRESULT_WIN32_C(ERROR_IO_INCOMPLETE) = incomplete but not fatal.

Member Data Documentation

◆ k_SIGNATURE

const FOURCC GrayLib::cSecureKnock::k_SIGNATURE = ((DWORD)(BYTE)( 'G' ) | ((DWORD)(BYTE)( 'S' ) << 8) | ((DWORD)(BYTE)( 'e' ) << 16) | ((DWORD)(BYTE)( 'c' ) << 24 ))
static

sent by client as an opening signature.

◆ k_SizeMin

const size_t GrayLib::cSecureKnock::k_SizeMin = 14
static

min size in bytes for this serialized message. 8 + 6.

◆ m_nCryptAbilities

WORD GrayLib::cSecureKnock::m_nCryptAbilities

Am i limited in my crypt abilities ? mask of CIPHER_TYPE. CIPHER_KEY_RSA.

◆ m_nSignature

FOURCC GrayLib::cSecureKnock::m_nSignature

const cSecureKnock::k_SIGNATURE to declare my protocol

◆ m_nVersion

WORD GrayLib::cSecureKnock::m_nVersion

const _INC_cSecureChannel_H = my protocol version id


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