# Validating Signature JWT with Certificate RS512

**URL:** <https://community.auth0.com/t/validating-signature-jwt-with-certificate-rs512/47005>\
**Category:** JWT.io\
**Created:** [July 27, 2020, 5:32pm UTC](https://community.auth0.com/t/validating-signature-jwt-with-certificate-rs512/47005 "2020-07-27T17:32:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luigi.siano](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/luigi.siano/32/22794_2.png) [@luigi.siano](https://community.auth0.com/u/luigi.siano)\
**Post date:** [July 27, 2020, 5:32pm UTC](https://community.auth0.com/t/validating-signature-jwt-with-certificate-rs512/47005/1 "2020-07-27T17:32:56Z")

</div>

Manualy validating the tokens signatures has been easy so far, I get the token and paste it on [jwt.io](http://jwt.io) and then I get my certificate and paste it on the PublicKey/Certificate field, and if the signature is valid it will show below.

Now I gotta do that in C#

I tried using JOSE Library  
string token = [MYTOKEN];  
string certificate = [MYCERTIFICATE]  
string json = Jose.JWT.Decode(token, certificate);

but I’m getting this error  
rsa using sha alg expects key to be of asymmetric algorithm type

Any tips on to how I can do this signature verification work?

---

<div class="post-metadata">

**Author:** ![john.gateley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john.gateley/32/10879_2.png) [@john.gateley](https://community.auth0.com/u/john.gateley)\
**Post date:** [July 28, 2020, 1:32pm UTC](https://community.auth0.com/t/validating-signature-jwt-with-certificate-rs512/47005/2 "2020-07-28T13:32:14Z")

</div>

Hi @luigi.siano

You probably want to use middleware to do this for you. If you are going to do it manually, you don’t want to hardcode the certficate as you are doing, you want to use the JSON web key set to get the key (and cache it, so you don’t call the endpoint over and over). Start here:

> **[Validate Access Tokens](https://auth0.com/docs/secure/tokens/access-tokens/validate-access-tokens)**
>
> Describes how to validate an access token.

> **[Validate JSON Web Tokens](https://auth0.com/docs/secure/tokens/json-web-tokens/validate-json-web-tokens)**
>
> Describes how to parse and validate a JSON web token (JWT).

> **[JSON Web Key Sets](https://auth0.com/docs/secure/tokens/json-web-tokens/json-web-key-sets)**
>
> A JSON Web Key set is a JSON object which represents a set of JSON Web Keys (a JSON object that represents a cryptographic key).

John

---

<div class="post-metadata">

**Author:** ![luigi.siano](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/luigi.siano/32/22794_2.png) [@luigi.siano](https://community.auth0.com/u/luigi.siano)\
**Post date:** [July 28, 2020, 3:51pm UTC](https://community.auth0.com/t/validating-signature-jwt-with-certificate-rs512/47005/3 "2020-07-28T15:51:09Z")

</div>

Hi John,

I looked in to all that,  
I’m working on a QA Project so I’m not going to be doing it manually.  
I just shared what Im trying to replicate with code, manually I got to [JWT.io](http://JWT.io), paste the token and the certificate and the I get a confirmation that the signature is valid.

I need to do that with code, and I haven’t been able to do it yet.  
Most of the information I’m seeeing online talks about how to validate using the token and the key  
but my inputs are the token and the certificate, so I don’t really know how to do this.
