The main security preferenc dialog needs to be able to
Create a temporary SSL_Options object to use while updating the preferences.
SSL_Options *m_options_manager = g_ssl_api->CreateSecurityManager(TRUE,);
if(!m_options_manager)
return OpStatus::ERR;
Protocolflags (checkboxes):
Other checkboxes:
Security Password settings (radiobuttons)
m_options_manager->PasswordAging can have these enumerated values:
Saving the Security Preferences
Update the members of m_options_manager listed above with the new values, as well as updating
with the appropriate values. Then call
g_ssl_api->CommitOptionsManager(m_options_manager); if(m_options_manager->dec_reference() <= 0) delete m_options_manager; m_options_manager = NULL;
Cancel Security Preferences:
if(m_options_manager->dec_reference() <= 0) delete m_options_manager; m_options_manager = NULL;
Creating the personal certificate context:
SSL_Certificate_DisplayContext *personal_cert_contex = new SSL_Certificate_DisplayContext(IDM_PERSONAL_CERTIFICATES_BUTT); personal_cert_contex->SetExternalOptionsManager(m_options_manager);
All the updates to the certificate database in the UI is commited to the security preferences in m_options_manager, which will be committed as described above.
An independent SSL_Options object may be used, but in such cases, the object must be committed and deleted separately.
Independent API's can be used to start a certificate dialog, if this is not desired the StartSecurityCertBrowsing and InitSecurityCertBrowsing APIs defined in the SSL Certificate DisplayContext document can be used.
Creating the authority certificate context:
SSL_Certificate_DisplayContext *authority_cert_contex = new SSL_Certificate_DisplayContext(IDM_SITE_CERTIFICATES_BUTT); authority_cert_contex->SetExternalOptionsManager(m_options_manager);
All the updates to the certificate database in the UI is commited to the security preferences in m_options_manager, which will be committed as described above.
An independent SSL_Options object may be used, but in such cases, the object must be committed and deleted separately.
Independent API's can be used to start a certificate dialog, if this is not desired the StartSecurityCertBrowsing and InitSecurityCertBrowsing APIs defined in the SSL Certificate DisplayContext document can be used.
This dialog contains a list of ciphers, described by a textstring (not translated), and an indication for each of whether or not it is enabled.
Retrieving the preferences (pseudo code):
SSL_ProtocolVersion SSLID_ver; const char *label;
label = "SSL/TLS ciphers"); SSLID_ver.Set(3,0); // Set titlebar text to label
int i = 0; long pos = 0; BOOL selected;
char tmp[255]; // Textstring
while (m_options_manager->GetCipherName(SSLID_ver, i, tmp, selected))
{
AddStringtoListWithSelectedStatus(tmp,selected)
i++;
}
Saving the SSL cipher selection (pseudo code):
Create an array ilist of num elements that contain the *zero-based* indexes of the selected ciphers, listed in the same order they were retrieved from m_options_manager.
m_options_manager->SetCiphers(SSLID_ver, num, ilist);