{{theTime}}

Search This Blog

Total Pageviews

Java8 Base64 for Encoding and Decoding

java.util.Base64

Third-party libraries were used for encoding and decoding Base-64. It could be a frequent operation and several projects use different implementation from Apache Commons-codes/Sprint/Guava.  Now Java 8 has java.util.Base64 and has the following methods:

getUrlEncoder()
getEncoder()
getUrlDecoder()
getDecoder()

The URL Base-64 Encoder provides an encoding that is URL and Filename safe (62 is - and 63 is _)

No comments:

How to generate Digital Certificate?

keytool -genkey -v -keystore c:\Users\<user>\key.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias key