Skip to content

gsellitto/RSAJWT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RSAJWT

Simple use:

    //Password for public&private key file
    JWT.JWTUtils.RSAENCRYPTPASSORD = "Wsd345TgdskkE334";
    //public&private key file
    JWT.JWTUtils.RSAKEYPATH = "C:\\rsa1.txt";
    //public key in XML format, the library copy in rsapub1.PEM the same key in PEM format
    JWT.JWTUtils.RSAPUBKEYPATH = "C:\\rsapub1.xml";
    string t = JWT.JWTUtils.CreateToken("Alice", "2",JWT.Managers.SecretType.RSAKey);
    
    //token verification
    using StreamReader fileStream = new StreamReader("C:\\rsapub1.xml");
    string pubkey=fileStream.ReadToEnd();
    var v = JWT.JWTUtils.VerifyToken(t, k, JWT.Managers.SecretType.RSAKey);
    if (v.valid) {
        //use list of claims v.claims
    }        
                 

About

JSON Web Token with RSA keys

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages