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

 ALL


  Permutation implementation in Java

Permutation is a very basic and important mathematic concept we learned in school. It has very practical applications in real world. For example, in football.In simple, permutation describes all possible ways of doing something. For example, there are six permutations of the set {1,2,3}, namely: (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), and (3,2,1). In general, for n items, there are n! number of permutations to arrange these items. How can we implement this algorithm in programming programming language such as Java? Below is a simple code snippet which uses the recursive method. It's quite...

7,673 4       JAVA PERMUTATION IMPLEMENTATION SAMPLE


  Different types of keystore in Java -- DKS

Domain KeyStore(DKS) is a keystore of keystore. It abstracts a collection of keystores that are presented as a single logical keystore. Itself is actually not a keystore. This new keystore type is introduced in Java 8. There is a new class DomainLoadStoreParameter which closely relates to DKS.To load different keystores into the single logical keystore, some configuration is needed. Here is the format of the configuration for grouping different keystores.domain [ ...] { keystore [ ...] ; ...};Below is one sample configuration for domain domain.domain app1 { keystore app1-...

12,734 0       JAVA TUTORIAL KEYSTORE DKS


  Memory related exception analysis in Java

Java Virtual Machine Specification divides the memory of JVM into several areas : Heap, Stack, The Program Counter register and Method area etc. In HotSpot JVM, heap is composed of Young, Tenured and Perm. There are different OutOfMemory error can happen in different memory area. Next is an overview of some of these OOM errors.StackOverflowErrorThe JVM will allow only a specified number of stacks created nested. An JVM option -Xss can be set to determine the maximum stack size. If the number of stacks created is more than the maximum allowed, a java.lang.StackOverflowError will be thrown....

3,994 0       JAVA MEMORY MODEL MEMORY EXCEPTION OOM


  Different types of keystore in Java -- PKCS11

PKCS11 keystore is designed for hardware storage modules(HSM). It's an interface to talk to the HSMs. It doesn't actually store any keys but provide a set of classes to communicate with the underlying HSM. The actual keys and certificates are stored on the HSMs.The reason for storing the keys and materials is to ensure security and efficiency. Since the keys are on the HSMs, they are safe to be stolen. All encryption/decryption operations are performed on the HSMs as well, this increase the processing speed. They are frequently used in applications requiring high speed and extra sec...

23,900 2       JAVA KEYSTORE PKCS11 HSM


  What does super.clone() do?

Object class has a protected clone() method declared to make it possible for all classes make a clone of itself when needed. The clone() is often used when a new instance of the class is needed while at the same time to maintain the same state as the original object. Any class which wants to have clone enabled has to implement the marker interface Cloneable.If a class which implements Cloneable doesn't override the Object.clone() method, the Object.clone() method will be called to just make a binary copy of the original, which amounts to a shallow clone, with all the referenced objects staying...

28,381 0       JAVA CLONEABLE SUPER.CLONE() CLONE


  Different types of keystore in Java -- JCEKS

JCEKS stands for Java Cryptography Extension KeyStore and it is an alternative keystore format for the Java platform. Storing keys in a KeyStore can be a measure to prevent your encryption keys from being exposed. Java KeyStores securely contain individual certificates and keys that can be referenced by an alias for use in a Java program.The process of storing and loading different entries in JCEKS is similar to what JKS does. So please refer to the article Different types of keystore in Java -- JKS. Change the keystore type from JKS to JCEKS accordingly when calling KeyStore.getInstance().In ...

52,908 1       JAVA TUTORIAL KEYSTORE JCEKS


  Different types of keystore in Java -- PKCS12

PKCS12 is an active file format for storing cryptography objects as a single file. It can be used to store secret key, private key and certificate.It is a standardized format published by RSA Laboratories which means it can be used not only in Java but also in other libraries in C, C++ or C# etc. This file format is frequently used to import and export entries from or to other keystore types.Next we will explain the operations which can be performed on PKCS12 keystore.Create PKCS12 keystoreBefore storing an entry into a PKCS12 keystore, the keystore has to be loaded first. This means we have t...

77,246 10       JAVA PKCS12 KEYSTORE TUTORIAL


  Polymorphism in OOP programming

Polymorphism is the capability of an action or method to do different things based on the object that it is acting upon. This is the third basic principle of object oriented programming. Overloading, overriding and dynamic method binding are three types of polymorphism.Overloaded methods are methods with the same name signature but either a different number of parameters or different types in the parameter list. For example 'spinning' a number may mean increase it, 'spinning' an image may mean rotate it by 90 degrees. By defining a method ...

8,867 0       JAVA OOP POLYMORPHISM OVERLOADING OVERRI