Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 PROGRAMMING


  Convert JKS to BKS using keytool

There are lots of questions(question 1, question 2) on Stackoverflow about how to convert JKS keystore to BKS keystore(a keystore format provided by BouncyCastle) using Java keytool. The reason why this conversion gets lots of questions is that BKS is not a keystore format supported by Java SE, it's a third party keystore format. To convert JSK to BKS, the BKS provider has to be downloaded first. And a few more options needs to be added when running the keytool command.The typical command to convert JKS keystore to BKS keystore should look like below :keytool -importkeystore -srckeys...

19,061 3       JAVA SECURITY JKS KEYTOOL BKS


  Java development company briefs about Lazy and Eager fetch in JPA/Hibernate

Normal 0 false false false EN-IN X-NONE X-NONE

3,290 0       JAVA JAVA DEVELOPMENT COMPANY LAZY FETCH EAGER FETCH JPA HIBERNET


  Different types of keystore in Java -- BKS

BKS is a keystore format provided by the popular third party Java cryptographic library provider -- BouncyCastle. It is a keystore similar to the JKS provided by Oracle JDK. Before starting to use BKS, the BouncyCastle provider has to be downloaded and installed. To download the provider, please go to BouncyCastle download page. The provider can be installed by adding an entry in the java.security file.security.provider.N=org.bouncycastle.jce.provider.BouncyCastleProviderN means the provider index in the provider list.Creating BKS keystoreTo create a BKS keystore, you just need to create ...

31,646 0       JAVA KEYSTORE BOUNCYCASTLE BKS


  Generating CSR using Java

A CSR(Certificate Signing Request) is a kind of request generated by an application and is to be sent to a Certificate Authority to create a signed certificate which can be distributed. It usually contains certificate information such as subject name, public key info and signature info.In Java, keytool can be used to generate a certificate request with option -certreq.  But sometimes if an application wants to create a CSR programmatically, keytool will not do a favor, instead you should use APIs provided by Java to generate CSRs.Basically the steps to generate a CSR are :Get the key...

25,206 0       JAVA SECURITY CSR CERTIFICATE REQUEST


  Different ways to print "Hello world" in Java

This post is not about best practice to print "Hello world" in Java, it is about exploring different capabilities offered by Java. Also there are articles about printing "Hello world" in different programming languages, but this post is not about that.Standard literalThe most commonly used way is to use System.out to print"Hello world".System.out.println("Hello world");EnumerationAn enumeration can define a set of values belonging to one category. For example, an enumeration for all months in a year. Another great use of enumeration is in writing testcases to accept different testing para...

7,840 0       JAVA FEATURE


  Run executable jar on double click on Windows

Normally after installing Java, there will be an association between .jar and the javaw.exe. This enables the executable jar to be opened on double click. You can check the association by going to Control Panel -> Programs -> Default Programs -> Associate a file type or protocol with a program.The default program of a file type can be changed in this dialog. However sometimes there are cases where the file association for .jar may be altered after a third party application installed. The executable jar may not be able to be started normally post that and it still doesn't work eve...

26,061 3       JAVA WINDOWS JAR EXECUTABLE JAR


  How many programmers does it take to screw in a lightbulb?

There seem to be a lot of “How many programmers does it take to screw in a lightbulb?” jokes floating around the Internet, but none aimed specifically for us SQA folk.  I have decided (perhaps mistakenly) that this is no longer acceptable.  If this decision is a mistake, I'm sure that someone else in QA will report it up as a bug and assign it to me.  For better or worse, there is now an SQA set of these jokes, thanks to me.  Now, without further ado, let the puns commence:How many developers does it take to screw in a lightbulb?  None – that’s ...

3,616 0      


  Launch Java process programmatically in Java

In some cases while working on some automation testcase, developers would like to launch Java process programmatically so that the tests can be ran without manual intervention. Java provides such methods to achieve this.ProcessBuilder can be used to build a Java process which can be launched when everything is ready. Basically it can take a list of parameters which are similar to the command line options/arguments. For example, if you want to launch a Java process, you can do following.public final class JavaProcess { private String output = ""; private String javaHome = ""; public ...

8,308 0       JAVA COMMAND LINE PROCESSBUILDER