public class SignedWithSecretKeyJWTRepository extends Object implements JwtRepository<Key>
| 构造器和说明 |
|---|
SignedWithSecretKeyJWTRepository() |
| 限定符和类型 | 方法和说明 |
|---|---|
long |
getAllowedClockSkewSeconds() |
io.jsonwebtoken.CompressionCodecResolver |
getCompressionCodecResolver() |
io.jsonwebtoken.CompressionCodec |
getCompressWith() |
JwtPayload |
getPlayload(Key secretKey,
String token,
boolean checkExpiry)
Parser JSON Web Token (JWT)
|
String |
issueJwt(Key secretKey,
String jwtId,
String subject,
String issuer,
String audience,
Map<String,Object> claims,
String algorithm,
long period)
Issue JSON Web Token (JWT)
|
String |
issueJwt(Key secretKey,
String jwtId,
String subject,
String issuer,
String audience,
String roles,
String permissions,
String algorithm,
long period)
Issue JSON Web Token (JWT)
|
void |
setAllowedClockSkewSeconds(long allowedClockSkewSeconds) |
void |
setCompressionCodecResolver(io.jsonwebtoken.CompressionCodecResolver compressionCodecResolver) |
void |
setCompressWith(io.jsonwebtoken.CompressionCodec compressWith) |
boolean |
verify(Key secretKey,
String token,
boolean checkExpiry)
Verify the validity of JWT
|
public String issueJwt(Key secretKey, String jwtId, String subject, String issuer, String audience, String roles, String permissions, String algorithm, long period) throws org.apache.shiro.authc.AuthenticationException
issueJwt 在接口中 JwtRepository<Key>secretKey - : Signing keyjwtId - : Jwt Idsubject - : Jwt Subjectissuer - : Jwt Issueraudience - : Jwt Audienceroles - : The Rolespermissions - : The Permsalgorithm - : Supported algorithms:
HS256: HMAC using SHA-256
HS384: HMAC using SHA-384
HS512: HMAC using SHA-512
ES256: ECDSA using P-256 and SHA-256
ES384: ECDSA using P-384 and SHA-384
ES512: ECDSA using P-521 and SHA-512
RS256: RSASSA-PKCS-v1_5 using SHA-256
RS384: RSASSA-PKCS-v1_5 using SHA-384
RS512: RSASSA-PKCS-v1_5 using SHA-512
PS256: RSASSA-PSS using SHA-256 and MGF1 with SHA-256
PS384: RSASSA-PSS using SHA-384 and MGF1 with SHA-384
PS512: RSASSA-PSS using SHA-512 and MGF1 with SHA-512
period - : Jwt Expiration Cycleorg.apache.shiro.authc.AuthenticationException - When Authentication Exceptionpublic String issueJwt(Key secretKey, String jwtId, String subject, String issuer, String audience, Map<String,Object> claims, String algorithm, long period) throws org.apache.shiro.authc.AuthenticationException
issueJwt 在接口中 JwtRepository<Key>secretKey - : Signing keyjwtId - : Jwt Idsubject - : Jwt Subjectissuer - : Jwt Issueraudience - : Jwt Audienceclaims - : Jwt Claimsalgorithm - : Supported algorithms:
HS256: HMAC using SHA-256
HS384: HMAC using SHA-384
HS512: HMAC using SHA-512
ES256: ECDSA using P-256 and SHA-256
ES384: ECDSA using P-384 and SHA-384
ES512: ECDSA using P-521 and SHA-512
RS256: RSASSA-PKCS-v1_5 using SHA-256
RS384: RSASSA-PKCS-v1_5 using SHA-384
RS512: RSASSA-PKCS-v1_5 using SHA-512
PS256: RSASSA-PSS using SHA-256 and MGF1 with SHA-256
PS384: RSASSA-PSS using SHA-384 and MGF1 with SHA-384
PS512: RSASSA-PSS using SHA-512 and MGF1 with SHA-512
period - : Jwt Expiration Cycleorg.apache.shiro.authc.AuthenticationException - When Authentication Exceptionpublic boolean verify(Key secretKey, String token, boolean checkExpiry) throws org.apache.shiro.authc.AuthenticationException
verify 在接口中 JwtRepository<Key>secretKey - :
If the jws was signed with a SecretKey, the same SecretKey should be specified on the JwtParser.
If the jws was signed with a PrivateKey, that key's corresponding PublicKey (not the PrivateKey) should be specified on the JwtParser.
token - : JSON Web Token (JWT)checkExpiry - : If Check validity.org.apache.shiro.authc.AuthenticationException - When Authentication Exceptionpublic JwtPayload getPlayload(Key secretKey, String token, boolean checkExpiry) throws org.apache.shiro.authc.AuthenticationException
getPlayload 在接口中 JwtRepository<Key>secretKey - :
If the jws was signed with a SecretKey, the same SecretKey should be specified on the JwtParser.
If the jws was signed with a PrivateKey, that key's corresponding PublicKey (not the PrivateKey) should be specified on the JwtParser.
token - : JSON Web Token (JWT)checkExpiry - : If Check validity.JwtPayloadorg.apache.shiro.authc.AuthenticationException - When Authentication Exceptionpublic long getAllowedClockSkewSeconds()
public void setAllowedClockSkewSeconds(long allowedClockSkewSeconds)
public io.jsonwebtoken.CompressionCodec getCompressWith()
public void setCompressWith(io.jsonwebtoken.CompressionCodec compressWith)
public io.jsonwebtoken.CompressionCodecResolver getCompressionCodecResolver()
public void setCompressionCodecResolver(io.jsonwebtoken.CompressionCodecResolver compressionCodecResolver)
Copyright © 2018. All rights reserved.