title: IDX10634: Unable to create the SignatureProvider SignatureAlgorithm: 'SHA256',
body: <p>I tried with the below suggestion,it is working for  SecurityAlgorithms.HmacSha256Signature. </p>
  
  <p>Suggested Code: </p>
  
  <pre><code>SigningCredentials = new SigningCredentials( new SymmetricSecurityKey(symmetricKey), Microsoft.IdentityModel.Tokens.SecurityAlgorithms.HmacSha256Signature)
  </code></pre>
  
  <p>but it is not working for SecurityAlgorithms.RsaSha256Signature.</p>
  
  <pre><code>Microsoft.IdentityModel.Tokens.SigningCredentials SigningCredentials = new Microsoft.IdentityModel.Tokens.SigningCredentials(_signingKey, SecurityAlgorithms.RsaSha256Signature);
  </code></pre>
  
  <p>I got the below error.</p>
  
  <p>DX10634: Unable to create the SignatureProvider.</p>
  
  <p>SignatureAlgorithm: 'SHA256', SecurityKey: 'Microsoft.IdentityModel.Tokens.SymmetricSecurityKey' is not supported</p>
  
  <p>I need to convert JWT token for Sha256. kindly provide solution with sample code.</p>
  
  <p>Please find my code:</p>
  
  <pre><code>       string _privateSecretKey = "MIIEogIBAAKCAQEAytYejMhaYjZwFgqP7WKh2bkf08=";
  
          Microsoft.IdentityModel.Tokens.SymmetricSecurityKey _signingKey = new Microsoft.IdentityModel.Tokens.SymmetricSecurityKey(Encoding.ASCII.GetBytes(_privateSecretKey));                
          Microsoft.IdentityModel.Tokens.SigningCredentials SigningCredentials = new Microsoft.IdentityModel.Tokens.SigningCredentials(_signingKey, SecurityAlgorithms.RsaSha256Signature);
  
          JwtHeader head = new JwtHeader();
          head.Add("kid", "firstpublickey");//TBD
  
          string sNewGuid = Guid.NewGuid().ToString("n");
  
          var claims = new[]
            {
                new Claim(JwtRegisteredClaimNames.Iss, oTokenPostData.ClientID),
              new Claim(JwtRegisteredClaimNames.Sub, oTokenPostData.ClientID),
              new Claim(JwtRegisteredClaimNames.Aud, oTokenPostData.tokenUri),
              new Claim(JwtRegisteredClaimNames.Jti,  sNewGuid),
                  new Claim(JwtRegisteredClaimNames.Exp, ((int)DateTime.Now.AddMinutes(55).Subtract(UnixEpoch).TotalSeconds).ToString(System.Globalization.CultureInfo.InvariantCulture)),
                  new Claim(JwtRegisteredClaimNames.Iat, ((int)DateTime.Now.Subtract(UnixEpoch).TotalSeconds).ToString(System.Globalization.CultureInfo.InvariantCulture))
            };
  
          JwtPayload payload = new JwtPayload(claims);               
  
          JwtSecurityToken jwt = new JwtSecurityToken(head, payload);              
  
  
          var encodedJwt = new JwtSecurityTokenHandler().WriteToken(jwt);
  </code></pre>