Database Reference
In-Depth Information
However, before it is closed and we continue on with the application, we use the artifacts of the DES
secret password key to build a matching key on the client. We will use this key as long as we are in this
particular application to decode connection strings for the application; so we clone or duplicate all the
associated key components for continued use. Thereafter, the basic RSA and DES encryption key
members are available for reuse by new keys associated with each Oracle connection we will be making
for application transactions.
Everything I just described amounts to quite a list of functions, but it all occurs from the relatively
simple interface presented in Figure 12-1. A single input field for the two-factor authentication code, and
a Continue button are all we need to get the job done.
Figure 12-1.
Login screen
The Application Inner Class
We are providing an application inner class structure in our
Login
class for use by any application. The
code for the inner class is shown in Listing 12-1. By changing the package for the
Login
class, we can use
this inner class for multiple applications, taking the burden off individual developers to include an inner
class in their code. In the case of our security administrative interface application, the package is
orajavsec
. The complete inner class name will
orajavsec.Login$InnerRevLvlClass
. If there were another
application that defined the
Login
class in a package named
mynewpkg
, then the inner class would be
named
mynewpkg.Login$InnerRevLvlClass
. This difference is sufficient to distinguish different and
separate applications and their associated application connection strings. This is true even if the
definition of the inner class is identical except for that package name.
Listing 12-1.
The Login Class, Inner Class
package
orajavsec
;
public class
Login
extends JDialog {
public static class
InnerRevLvlClass
implements Serializable, RevLvlClassIntfc
{
private static final long serialVersionUID = 2011010100L;
private String innerClassRevLvl = "20110101a";
public String getRevLvl() {
return innerClassRevLvl;
}