How to Sign data and Verify signature in Node.JS

Another example that occurred to me. Very useful. What will we need? Private key in PEM format Public key in PEM format To get those you will have use OpenSSL, please take a look at this post How to generate RSA public and private keys with OpenSSL. For this example I am using the following 2048 bit RSA key pair: …

How to generate RSA public and private keys with OpenSSL

Before anything, I assume that you already have OpenSSL installed in your PC. In case you don’t and you are a Windows you can download it from this URLs: http://slproweb.com/products/Win32OpenSSL.html http://gnuwin32.sourceforge.net/packages/openssl.htm I personally used the first one. After you are done with the installation follow this steps: Open a command line window and run the following command: openssl genrsa -out …

How to generate X.509 certificate in Java 1.8

Here is how to do it, the simplest way, to generate the base64 string. No complications with KeyStores or things like that. I must say that I found this code in several places over the Internet. When I tried to run it I had some exceptions, I solved them, at the time of this writing, the following code works with …

How to generate RSA key pair in Java 1.8

Recently I was wondering how to generate a private key in Java for a personal project. I found out how to generate the actual key pair with RSA algorithm. Here is the java code for that, a simple class that you can run to check how things work. import java.security.KeyPairGenerator; import java.security.KeyPair; import java.security.PrivateKey; import java.security.PublicKey; import java.util.Base64; public class …