title: Issue with java.security.InvalidKeyException: Supplied key (sun.security.mscapi.RSAPrivateKey) is not a RSAPrivateKey instance
body: <p>Facing issue when getting certificate from windows Keystore. I think system generated certificate/private key is of type sun.security.mscapi.RSAPrivateKey, I need to convert or access it in java.security.interfaces.RSAPrivateKey type.</p>
  
  <p>I have seen several posts over the internet with users facing the same problem but not found single clear post contains the exact solution to the problem.</p>
  
  <p>Exception in thread "main" java.security.InvalidKeyException: Supplied key (sun.security.mscapi.RSAPrivateKey) is not a RSAPrivateKey instance</p>