title: .net RSA sign data error with PSS padding
body: <p>I have a question re. the use of Crypto in .net as follows. I have a .pem file which I am able to parse to a private key and would like to sign some data bytes. The code I'm using is below:</p>
  
  <pre><code>byte[] pemkey = Convert.FromBase64String(privateKeyString);
  
  RSACryptoServiceProvider RSA = DecodeRSAPrivateKey(pemkey);//function to parse .pem file
  
  byte[] fileBytes = File.ReadAllBytes(@"C:\...");
  
  byte[] signature = RSA.SignData(fileBytes, HashAlgorithmName.SHA256, RSASignaturePadding.Pss);
  </code></pre>
  
  <p>When running this, at the last statement (RSA.SignData), I've got an exception CryptographicException is not handled: <strong>Specified padding mode is not valid for this algorithm.</strong></p>
  
  <p>I'm not sure what is missing from my code as my search on Google did not return much result. </p>
  
  <p>Any help is appreciated. Many thanks</p>