utiltity class to use openssl
Public Methods
-
int StartSsl()
- initialize openssl library.
-
int StopSsl()
- finanlize openssl library.
-
int ClientStartSsl()
- establish SSL resources for being run by SSL client,
-
int ClientStopSsl()
- release SSL resource for SSL client.
-
int ServerStartSsl( char* szCertFileName, char* szKeyFileName )
- establish SSL resources for being run by SSL server.
-
int ServerStopSsl()
- release resource for SSL server.
-
SSL* ClientConnectSsl( SOCKET iFd )
- connect SSL server.
-
int ClientCloseSsl( SSL* ssl )
- close SSL connection with SSL server.
-
SSL* ServerAcceptSsl( SOCKET iFd )
- accept SSL connection.
-
int ServerCloseSsl( SSL* ssl )
- close SSL connection for SSL client.
-
int SendSsl( SSL* ssl, const char* szBuf, int iBufLen )
- send data with SSL protocol.
-
int RecvSsl( SSL* ssl, char* szBuf, int iBufLen, int iSecond )
- receive data with SSL protocol
-
char* GetErrorMessage()
- return error message.
-
int EncryptString( char* szUserKey, char* szInput, char* szOutput, int iOutputLen )
- encrypt string
-
int DecryptString( char* szUserKey, char* szInput, char* szOutput, int iOutputLen )
- decrypt encrytpion string.
-
unsigned char* GetMessageDigest( char* szAlgorithm, char* szBuf, unsigned int iLen, int* iReturnLen )
- Return HASH value about inputed string.
Documentation
utiltity class to use openssl
int StartSsl()
- initialize openssl library.
- Returns:
- if success, return 0.
if already intialize, return 1.
otherwise return -1.
if you want to read error message, see m_szErrorMessage variable.
int StopSsl()
- finanlize openssl library.
- Returns:
- if success, return 0.
otherwise return -1.
if you want to read error message, see m_szErrorMessage variable.
int ClientStartSsl()
- establish SSL resources for being run by SSL client,
- Returns:
- if success, return 0.
otherwise return -1.
- Author:
- Yee Young Han
int ClientStopSsl()
- release SSL resource for SSL client.
- Returns:
- if success, return 0.
otherwise return -1.
- Author:
- Yee Young Han
int ServerStartSsl( char* szCertFileName, char* szKeyFileName )
- establish SSL resources for being run by SSL server.
- Parameters:
- szCertFileName - cert file name - full path name
szKeyFileName - key file name - full path name
- Returns:
- if success, return 0.
otherwise return -1.
- Author:
- Yee Young Han
int ServerStopSsl()
- release resource for SSL server.
- Returns:
- if success, return 0.
otherwise return -1.
- Author:
- Yee Young Han
SSL* ClientConnectSsl( SOCKET iFd )
- connect SSL server.
- Parameters:
- iFd - socket descriptor
- Returns:
- if success, return SSL struct pointer.
otherwise return NULL.
- Author:
- Yee Young Han
int ClientCloseSsl( SSL* ssl )
- close SSL connection with SSL server.
- Parameters:
- ssl - SSL struct
- Returns:
- if success, return 0.
otherwise return -1.
- Author:
- Yee Young Han
SSL* ServerAcceptSsl( SOCKET iFd )
- accept SSL connection.
- Parameters:
- iFd - ¼ÒÄÏ ÇÚµé
- Returns:
- if success, return SSL struct pointer.
otherwise return NULL.
- Author:
- Yee Young Han
int ServerCloseSsl( SSL* ssl )
- close SSL connection for SSL client.
- Returns:
- if success, return 0.
otherwise return -1.
- Author:
- Yee Young Han
int SendSsl( SSL* ssl, const char* szBuf, int iBufLen )
- send data with SSL protocol.
This function is wrapper function of SSL_write and Until transmit all data, attempt transmission.
- Parameters:
- ssl - SSL struct
szBuf - buffer for sending
iBufLen - buffer size
- Returns:
- if success, return sending counf.
otherwise return -1.
- Author:
- Yee Young Han
int RecvSsl( SSL* ssl, char* szBuf, int iBufLen, int iSecond )
- receive data with SSL protocol
- Parameters:
- ssl - SSL struct
szBuf - buffer for receving
iBufLen - size of buffer
iSecond - If data is not received in reception latency time-this time, return reception error.
- Returns:
- return size of receiving data.
- Author:
- Yee Young Han
char* GetErrorMessage()
- return error message.
- Returns:
- error message
int EncryptString( char* szUserKey, char* szInput, char* szOutput, int iOutputLen )
- encrypt string
- Parameters:
- szUserKey - [in] password for encryption
szInput - [in] plain text
szOutput - [out] encryption string
iOutputLen - [in] size of szOutput
- Returns:
- if success, return 0.
otherwise return -1.
int DecryptString( char* szUserKey, char* szInput, char* szOutput, int iOutputLen )
- decrypt encrytpion string.
- Parameters:
- szUserKey - [in] password for decryption
szInput - [in] encryption string
szOutput - [out] plain string
iOutputLen - [in] size of szOutput
- Returns:
- if success, return 0.
otherwise return -1.
unsigned char* GetMessageDigest( char* szAlgorithm, char* szBuf, unsigned int iLen, int* iReturnLen )
- Return HASH value about inputed string.
String that is returned through this function must release by user.
- Parameters:
- szAlgorithm - [in] hash algorithm
szBuf - [in] string to convert HASH
iLen - [in] length of szBuf
iReturnLen - [in] length of return string
- Returns:
- if success, return Hash string.
otherwise return NULL.
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.