title: Wrong key usage in encryption
body: <p>This class encrypt data values, to do this first I get the cipher as follows,</p>
  
  <pre><code>KeyStore primaryKeyStore = getKeyStore(keyStoreFile, password, keyType, provider);
  java.security.cert.Certificate certs = primaryKeyStore.getCertificate(aliasName);
  cipher = Cipher.getInstance("RSA");
  cipher.init(Cipher.ENCRYPT_MODE, certs);
  </code></pre>
  
  <p>But the last line of the above code gives the following error.
  What does the wrong key usage means?
  Can't I use this certificate for encryption purposes?
  Is there separate certificate for encryption?</p>
  
  <pre><code>Caused by: java.security.InvalidKeyException: Wrong key usage 
  at javax.crypto.Cipher.init(Cipher.java:1640) 
  at javax.crypto.Cipher.init(Cipher.java:1549) 
  at my.test.ciphertool.CipherTool.initCipher(CipherTool.java:167) 
  ... 1 more 
  </code></pre>