title: How to sign with Bouncy Castle using RSA with SHA1 and ISO9796-2 scheme 2?
body: <p>I need to sign the SHA1 hash of a text with RSA and ISO9796-2 scheme 2 padding</p>
  
  <p>Initially I was doing it only with SHA1 with RSA like this:</p>
  
  <pre><code>public static byte[] signer(byte[] data, PrivateKey key) throws Exception {
      Signature signer = Signature.getInstance("SHA1WithRSA", "BC");
      signer.initSign(key);
      signer.update(data);
      return signer.sign();
  }
  </code></pre>
  
  <p>How should I modify the function? It would be easy to just replace "SHA1WithRSA" with another scheme that does what I need but I don't know if it's possible.</p>