Wednesday, 30 December 2015

Sunday, 20 December 2015

The Principal Interface and Other Key Interfaces of java.security

java.security.Principal is the interface in Java for security "principals" such as logins, individuals or other forms of entities. An example class implementation of this interface is X500Principal which has been available since Java 1.4.

Another crucial interface in the java.security package is Key, which is the parent interface for all keys. Keys are fundamental to numerous cryptographic processes, for example in symmetric encryption you encrypt and decrypt with the same key.  All keys are stored with an associated algorithm, usually an encryption or asymmetric operation (e.g. DSA - digital signature algorithm,  or RSA) and an encoded form (perhaps required for processing outside of the JVM). In this light, the methods available on the Key interface will come as no surprise - getAlgorithm returns a String representation of the algorithm name and getEncoded returns a byte array of the encoded key, or null if not applicable.

Keys are so important that even the subinterfaces of Key namely PrivateKey and PublicKey are included in the top-level java.security package.  PrivateKey is merely a marker interface containing no methods or constants. It simply groups (and provide type safety for) all private key interfaces. This is the same pattern for the PublicKey interface. Further subinterfacing is done at the java.security.interfaces level. This includes interfaces for RSA keys and elliptic curve cryptography keys.

Now that we have seen Key (Private and Public) and Principals what else is left?

Java also provides core interfaces for managing Key Stores. As of Java 1.5, a key store can be implemented by subinterfacing or subclassing the marker interface KeyStore.Entry, and KeyStore.LoadStoreParameter.

Tuesday, 18 August 2015

Introduction to JEPs - The Java Enhancement Proposal Process

The JDK advances through JEPs. A JEP, or Java Enhancement Proposal, starts off as a Draft, and eventually into Submitted state for wider review. It gets promoted to Candidate phase if it is accepted for inclusion in the Roadmap by the OpenJDK lead. Even if in Candidate phase, it must move to Funded phase before it can reach the Completed state. JEP2 contains the text format in which a JEP must be written.

Wednesday, 12 August 2015

Saturday, 30 May 2015

8u45 and the JRE expiration date

The JRE expires when a new security update becomes available. 8u45 will expire on July 14, 2015. 8u45 contains a new blacklist JAR entry.

Sunday, 24 May 2015

IntelliJ IDEA Community Edition 14.1.3

The installer takes up about 195MB of disk space and then expands into around 550 MB. The UI theme can be set to IntelliJ (default) or Darcula (black background, with orange keywords e.g. import, new etc,). The next phase of the installer is Default Plugins (Java Frameworks such as JBoss Seam, Struts, Spring, J2EE), and Build Tools (ant, maven, gradle) and Web Development (HTML, JavaScript). There is also IdeaVIM, a VIM plugin which is not recommended - even if you are familiar with VIM. A Scala plugin is also an optional extra.


Friday, 22 May 2015

More Respect for Object-Relational Mapping in Java through JPA

As mentioned before, JPA is important. What JPA is can be understood here.

Thursday, 2 April 2015

Groovy in Action

Learning how to script in Groovy can be daunting without some extra help.

Here are some learning tips and resources.

BOOKS

"Groovy in Action" by technology publishers Manning Publications (2007) is a great introduction which doubles up as a helpful code mentor which will get you Groovy-ing in no time - without having to traipse the Interweb for code samples!

TOOLS

groovysh - is the groovy shell..  When you are done, type :x to exit the shell
groovyConsole - loads and runs groovy files