This is a demonstration of the NoCon framework in action. This example uses a single view
to present the user interface for a set of OpenSSL encryption methods. Additional assets have
been added to the framework to provide the functionality in the demonstration.
- SSLTest/SSLKey.php class files: Provides methods to interact with OpenSSL.
- JQuery and JQuery UI: Used to implement the user interface in the DOM.
The original Home view that comes with the framework is retained and a Keys view was added
to contain the tabs and forms for the OpenSSL tests. The application configuration was
changed to make the Keys view the default view. You can still load the Home view using
the link in the navigation bar.
There is one additional route that does not include a layout or view. A preprocess script
was added for the 'api' view route which processes AJAX requests from the Keys forms. The
preprocess script provides a JSON output itself and does not require a view script and
therefore calls the Router::disableView() method to prevent any layout or view loading
after the preprocess completes. As a result you will not see an api.php script in the view
folder. Instead you have only the api.php script in the preprocess/viewprocess/ folder.
The following is a manifest of the files and assets that were added to the framework to create the demonstration...
- preprocess/viewprocess/api.php - The preprocess script to handle AJAX requests to the 'api' route.
- view/keys.php - The keys view that will contain the user interface for the OpenSSL tests.
- view/subview/tab/introduction.php - The content for the Introduction tab.
- view/subview/tab/create.php - The content for the Create tab.
- view/subview/tab/fullkey.php - The content for the Key tab.
- view/subview/tab/encryption.php - The content for the Encryption tab.
- css/jquery-ui.css - The JQuery UI CSS.
- css/images - The images directory for the JQuery UI styles.
- js/jquery.min.js - The JQuery library.
- js/jquery-ui.min.js - The JQuery UI library.
Create OpenSSL Keys
Enter all the details required to generate an OpenSSL private key and self
signed certificate. The new key values will be displayed on the Key tab.
Inspect OpenSSL Keys
When a key is created it will be displayed in this tab. Or you can enter the
values from a previously generated key. Note that you only need the certificate
element to perform an encryption operation and you only need the private key
and passphrase elements to perform a decryption operation.
Encrypt / Decrypt Using OpenSSL Keys
The key values on the Key tab will be used for encryption and decryption.
Note that you only need to have the certificate on the Key tab to perform
an encryption operation. And you only need the private key and passphrase
components to perform the decryption operation.
OpenSSL Tests by Bryan Nielsen, a NoCon based project.