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

SEARCH KEYWORD -- java



  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 u...

   JAVA,SECURITY,CSR,CERTIFICATE REQUEST     2016-05-25 04:49:17

  Recursive class initialization in Java

When a Java class is referenced and initialized, it has to go through the loading and linking first. Once the loading and linking complete successfully. The class will be initialized. The static variables and constant variables will be initialized during this process. Once the class is initialized, it is ready for use. If when class A is initialized and it is referencing a class B, the class B will also get initialized. But what will happen if class B is referencing class A as well? This is call...

   Java,JVM,class initialization,static final     2015-04-15 21:04:29

  Tomcat vs. Apache: Why One Over the Other?

When determining which type of web server to use, the differences and technical details can be daunting. It can be a difficult task to compare web servers and make the decision on which is best for you and your project. Since Apache is currently the most popular web server, this article will discuss the differences between the Apache Web Server and Apache Tomcat, which are very different and fulfill different needs.The Apache Web Server, often just called “Apache” or â€...

   Apache,Tomcat,Choice,Web server     2012-03-23 12:01:25

  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 co...

   JKS,BKS,KEYTOOL,JAVA,SECURITY     2016-07-14 03:49:52

  Java Cipher encryption/decryption example

In Java, Cipher is the API for doing data encryption/decryption. Many cryptographic algorithms such as AES, DES, RC4 etc can be specified when creating Cipher instance. The Cipher instance calls the underlying algorithm specific implementation to do the actual encryption/decryption.  Before doing the encryption/decryption, a key needs to be created and it will be used to do the encryption/decryption. A sample program for performing all these is : import java.security.Key; import javax.cryp...

   Java, Java Security, Cipher, Example, Sample     2015-08-14 07:07:10

  Different types of keystore in Java -- Windows-MY

Windows-MY is a type of keystore on Windows which is managed by the Windows operating system. It stores the user keys and certificates which can be used to perform cryptographic operations such as signature verification, data encryption etc. Since it's a kind of native keystore, Java doesn't have a general API to access it. To help Java applications access the keys and certificates stored in Windows-MY keystore, Java provides a separate API -- SunMSCAPI. The SunMSCAPI provider is ...

   JAVA,KEYSTORE,WINDOWS-MY,SUNMSCAPI     2016-01-09 05:45:59

  Why exception would be thrown when deleting element while looping through HashMap in Java

HashMap and other Collection types are frequently used in Java application programming. This post will explain why exception would be thrown when deleting element with Map.remove() while looping through a Map using Iterator. This issue would also occur to other Collection types such as Set, List. Below is a sample code snippet demonstrating the exception thrown. Map<String,String> map = Collections.synchronizedMap(new TreeMap<String,String>()); map.put("key1","value1"); map.put("ke...

   JAVA,HASHMAP,CONCURRENTMODIFICATIONEXCEPTION     2018-06-30 12:49:09

  Seven Java projects that changed the world

O\'Reilly is celebrating the release of Java 7, and our inaugural OSCON Java conference: July 25-27 in Portland, Ore. Java\'s open source ecosystem is strong and healthy, one of the primary reasons for our creation of OSCON Java. Over the last decade, several projects have traveled beyond mere adoption and had effects dominating the Java world, into software development in general, and some even further into the daily lives of users. JUnit Ported to Java by Kent Beck and Erich Gamma from Be...

   Java,Projects,Prominent,Eclipse,Sue     2011-07-26 02:50:42

  10 Points about Java heap memory

When I started java programming I didn't know what is java heap or what is heap space in Java, I was even not aware of where does object in Java gets created, it’s when I started doing professional programming I came across error java.lang.outofmemoryerror then I realized What is Heap in Java or Java Heap Space. Its happens with most of programmer because learning language is easy but learning basics is difficult since there is no formal process which can teach you every basics of pro...

   Java,Heap memory,Tips     2012-02-20 05:38:06

  Android socket programming example

Socket is a kind of interface for different sides t communicate, it usually identified by an IP and a port. There are many server side software on a server and they would provide different service. Each server many create some sockets and bind them to some ports so that clients can listen to. Software on the Internet will exchange data though a bidirectional connection established. Each end of the connection has a socket created. In Java, Socket and ServerSocket are in java.net package, ServerSo...

   Android,Socket,Java     2013-05-11 22:17:16