title: Which signature algorithm can handle RSA keys?
body: <p>I've developed an Java RMI Application. I have already implemented hybrid encryption for all communication between the different clients and servers. For my asymmetric keys I use RSA. Now I'm trying to implement signatures, using the <a href="https://docs.oracle.com/javase/7/docs/api/java/security/SignedObject.html" rel="nofollow noreferrer">SignedObject</a> class. As a third parameter when creating a new SignedObject, I have to pass a signature algorithm. My question is which signature algorithm is compatible to work with my already implemented RSA keys? </p>
  
  <p>Currently I'm using the default signature algorithm DSA, as mentioned in the documentation. However, when running the application I encounter the following error:</p>
  
  <pre><code>TweetClient exception (publish): java.security.InvalidKeyException: No installed provider supports this key: sun.security.rsa.RSAPrivateCrtKeyImpl
  java.security.InvalidKeyException: No installed provider supports this key: sun.security.rsa.RSAPrivateCrtKeyImpl
      at java.security.Signature$Delegate.chooseProvider(Signature.java:1138)
      at java.security.Signature$Delegate.engineInitSign(Signature.java:1179)
      at java.security.Signature.initSign(Signature.java:530)
      at java.security.SignedObject.sign(SignedObject.java:240)
      at java.security.SignedObject.&lt;init&gt;(SignedObject.java:160)
      at be.vub.parallellism.solutions.encryption.EncryptionUnit.encryptWithSecretKey(EncryptionUnit.java:80)
      at be.vub.parallellism.solutions.TweetClient.publish(TweetClient.java:137)
      at be.vub.parallellism.solutions.TweetClient.access$000(TweetClient.java:25)
      at be.vub.parallellism.solutions.TweetClient$1.run(TweetClient.java:126)
      at java.util.TimerThread.mainLoop(Timer.java:555)
      at java.util.TimerThread.run(Timer.java:505)
  
  </code></pre>