You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
987 B
22 lines
987 B
package com.fr.plugin.sso.test; |
|
|
|
import io.jsonwebtoken.Jwts; |
|
import io.jsonwebtoken.io.Decoders; |
|
import io.jsonwebtoken.security.Keys; |
|
|
|
import java.security.Key; |
|
|
|
public class Test { |
|
public static void main(String[] args) { |
|
Key otherKey = Keys.hmacShaKeyFor( |
|
Decoders.BASE64.decode("NjNhZGRhYWE3OTQ5NjM2ZmNiMGFjNTI2NzY5YzAyNWNjNzI4YjgwZjI4ZTk2MmMxM2E2MzM0NGUzOGIxZDI3M2Y2NGZhODg5NTQ5YjIxMTgyZjQ1OWQ5MTRjZTZlNDVmYjg0ZmM1YmNlMDQ3MmNmOGNkZmUwNTIzYTVmZDMyNzE") |
|
); |
|
|
|
try { |
|
io.jsonwebtoken.Jws<io.jsonwebtoken.Claims> aa = Jwts.parserBuilder().setSigningKey(otherKey).build().parseClaimsJws("eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ2LWludGx6aGFiaW5sb25nIiwiYXV0aCI6IlJPTEVfQURNSU4sUk9MRV9GSUxJTkcsUk9MRV9VU0VSIiwiZXhwIjoxNjE5NTE1ODUyfQ.DG5Vyyl6FLLqb9DGJCwSfBkCvkeLJfhnZKynMaMJukSoPsf4E85LZOsSMfIM4n3fVmZOSX72NWSAE7zh29RRRg"); |
|
System.out.println(aa); |
|
} catch (Exception e) { |
|
e.printStackTrace(); |
|
} |
|
} |
|
}
|
|
|