MySQL 8.3.0
Source Code Documentation
Rsa_authentication_keys Class Reference

#include <sql_authentication.h>

Public Member Functions

 Rsa_authentication_keys (char **private_key_path, char **public_key_path)
 
 ~Rsa_authentication_keys ()=default
 
void free_memory ()
 
void * allocate_pem_buffer (size_t buffer_len)
 
RSAget_private_key ()
 
RSAget_public_key ()
 
int get_cipher_length ()
 
bool read_rsa_keys ()
 Read RSA private key and public key from file and store them in m_private_key and m_public_key. More...
 
const char * get_public_key_as_pem (void)
 

Private Member Functions

void get_key_file_path (char *key, String *key_file_path)
 Set key file path. More...
 
bool read_key_file (RSA **key_ptr, bool is_priv_key, char **key_text_buffer)
 Read a key file and store its value in RSA structure. More...
 

Private Attributes

RSAm_public_key
 
RSAm_private_key
 
int m_cipher_len
 
char * m_pem_public_key
 
char ** m_private_key_path
 
char ** m_public_key_path
 

Constructor & Destructor Documentation

◆ Rsa_authentication_keys()

Rsa_authentication_keys::Rsa_authentication_keys ( char **  private_key_path,
char **  public_key_path 
)
inline

◆ ~Rsa_authentication_keys()

Rsa_authentication_keys::~Rsa_authentication_keys ( )
default

Member Function Documentation

◆ allocate_pem_buffer()

void * Rsa_authentication_keys::allocate_pem_buffer ( size_t  buffer_len)

◆ free_memory()

void Rsa_authentication_keys::free_memory ( )

◆ get_cipher_length()

int Rsa_authentication_keys::get_cipher_length ( )

◆ get_key_file_path()

void Rsa_authentication_keys::get_key_file_path ( char *  key,
String key_file_path 
)
private

Set key file path.

Parameters
[in]keyPoints to either m_private_key_path or m_public_key_path.
[out]key_file_pathStores value of actual key file path.

◆ get_private_key()

RSA * Rsa_authentication_keys::get_private_key ( )
inline

◆ get_public_key()

RSA * Rsa_authentication_keys::get_public_key ( )
inline

◆ get_public_key_as_pem()

const char * Rsa_authentication_keys::get_public_key_as_pem ( void  )
inline

◆ read_key_file()

bool Rsa_authentication_keys::read_key_file ( RSA **  key_ptr,
bool  is_priv_key,
char **  key_text_buffer 
)
private

Read a key file and store its value in RSA structure.

Parameters
[out]key_ptrAddress of pointer to RSA. This is set to point to a non null value if key is correctly read.
[in]is_priv_keyWhether we are reading private key or public key.
[out]key_text_bufferTo store key file content of public key.
Returns
Error status
Return values
falseSuccess : Either both keys are read or none are.
trueFailure : An appropriate error is raised.

◆ read_rsa_keys()

bool Rsa_authentication_keys::read_rsa_keys ( )

Read RSA private key and public key from file and store them in m_private_key and m_public_key.

Also, read public key in text format and store it in m_pem_public_key.

Returns
Error status
Return values
falseSuccess : Either both keys are read or none are.
trueFailure : An appropriate error is raised.

Member Data Documentation

◆ m_cipher_len

int Rsa_authentication_keys::m_cipher_len
private

◆ m_pem_public_key

char* Rsa_authentication_keys::m_pem_public_key
private

◆ m_private_key

RSA* Rsa_authentication_keys::m_private_key
private

◆ m_private_key_path

char** Rsa_authentication_keys::m_private_key_path
private

◆ m_public_key

RSA* Rsa_authentication_keys::m_public_key
private

◆ m_public_key_path

char** Rsa_authentication_keys::m_public_key_path
private

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