title: How to create signature for my JWT?
body: <p>According to JWT (specifically, using the Box.com api), you need to </p>
  
  <ol>
  <li><p>create your header and claims, base 64 url encode them, join them with a dot. </p></li>
  <li><p><a href="https://stormpath.com/blog/jwt-the-right-way/" rel="nofollow noreferrer">You then need to take that and the secret key (a little confusion here, more on that in a second) and then encrypt them</a>. For Box.com, it would be using RS256.</p></li>
  <li><p>You then send that to the provider (again, in this case Box.com) and everything should be fine and dandy.</p></li>
  </ol>
  
  <p>I have step 1 no problem. </p>
  
  <p>Step 2 is a bit of a problem for me. </p>
  
  <ol>
  <li><p>I assume I use my ... private key? Edit: Nope, private key is to decrypt.</p></li>
  <li><p>Although far too many examples exist of doing this with HSA, I need to use RSA and the System.IdentityModel.Tokens.JWT_stuff process has not been very forthcoming with helping. There are a couple other packages and libraries I could use that would be so easy if Box.com allowed for HSA256.</p></li>
  </ol>
  
  <p>I've taken a look at <a href="https://stackoverflow.com/questions/25909044/how-to-sign-bytes-using-my-own-rsa-private-key-using-rs256-algorithm">this question</a> and it hasn't been incredibly helpful.</p>
  
  <p>So what do I need to do to complete step 2? In other words: How can I encrypt using RSA256 in C#?</p>