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

 ALL


  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 command to convert JKS keystore to BKS keystore should look like below :keytool -importkeystore -srckeys...

18,944 3       JAVA SECURITY JKS KEYTOOL BKS


  Using Java keytool programmatically

Java provides a command line tool to access and operate different keystore which store keys and certificates. This tool is named keytool and is located at \bin. On command line, you can issue below command to generate a keystore named mytest.jks which contains a private key and certificate chain.keytool -genkeypair -alias mykey -keyalg RSA -sigalg SHA256withRSA -dname CN=Java -storetype JKS -keypass password -keystore mytest.jks -storepass passwordSometimes, in testing purpose, we may want to issue these command in our applications instead of start a command line terminal. This is...

23,781 14       JAVA KEYTOOL


  Using keytool to create certificate chain

JDK provides a command line tool -- keytool to handle key and certificate generation. This tool has a set of options which can be used to generate keys, create certificates, import keys, install certificate and export certificates etc. In this tutorial, we will show how to create certificate chain using keytool. If you want to understand how to create certificate chain programmably, please refer to Generate certificate in Java -- Certificate chain.To begin, we first generate a key pair which will be used as the CA, ts private key will be used to sign the certificate it issues.keytool -gen...

48,163 1       JAVA CERTIFICATE CERTIFICATE CHAIN KEYTOOL