Showing posts from 2019

Java Stream API

IntroductionJava stream API is not a really new API. This API has been introduced by Oracle since Java version 8. As specified inside the JDK documentation, Java stream is  A sequence of elements supporting sequential and parallel aggregate operations (source:

Stream API, when used properly, can help the use of collections simpler and easier, following the way of doing functional programming. Java stream API has plenty of operations available.

In today's post, we are going to run through some of the available operations provided by the stream API, including the sample source code and output from it. Due to so many operations available, we will limit our discussion to just several functions.

For the rest of the discussion, we will consider having TWO (2) classes, Student and ClassRoom. The code for the 2 classes is as below.
public class Student { private int age; private String name; public int getAge (…

Digital Signing with Java

In today's post, we are going to see how easy it is to do digital signing using Java programming language. Java has provided libraries that you can use out of the box to produce digital signature. Let's get started.
A little bit of theory For those of you who do not know yet about digital signature, this is basically a process that ensures that the content that you sent has not been altered in any way. Digital signature is one of the most important things to do in this digital world. Without it, it will be hard to verify data integrity.
Relationship with Hashing At this stage, one must have noticed that to check data integrity, you can actually use a hashing algorithm. For example, when you download a file from the internet, they usually provide the hash (be it MD5 or SHA1 or higher) for you to check the integrity of the downloaded file.
Although this is true, digital signing actually provides you with more than just a data integrity. Digital signing has tight integration wit…