public class SignedWithRsaAndEncryptedWithRsaJWTRepository extends Object implements JwtKeyPairRepository<com.nimbusds.jose.jwk.RSAKey,com.nimbusds.jose.jwk.RSAKey>
https://www.connect2id.com/products/nimbus-jose-jwt/examples/jwt-with-rsa-signature
https://www.connect2id.com/products/nimbus-jose-jwt/examples/jwt-with-rsa-encryption
https://www.connect2id.com/products/nimbus-jose-jwt/examples/signed-and-encrypted-jwt
| 构造器和说明 |
|---|
SignedWithRsaAndEncryptedWithRsaJWTRepository() |
| 限定符和类型 | 方法和说明 |
|---|---|
JwtPayload |
getPlayload(com.nimbusds.jose.jwk.RSAKey signingKey,
com.nimbusds.jose.jwk.RSAKey secretKey,
String token,
boolean checkExpiry)
Parser JSON Web Token (JWT)
|
JwtTimeProvider |
getTimeProvider() |
String |
issueJwt(com.nimbusds.jose.jwk.RSAKey signingKey,
com.nimbusds.jose.jwk.RSAKey secretKey,
String jwtId,
String subject,
String issuer,
String audience,
Map<String,Object> claims,
String algorithm,
long period)
Issue JSON Web Token (JWT)
|
String |
issueJwt(com.nimbusds.jose.jwk.RSAKey signingKey,
com.nimbusds.jose.jwk.RSAKey secretKey,
String jwtId,
String subject,
String issuer,
String audience,
String roles,
String permissions,
String algorithm,
long period)
Issue JSON Web Token (JWT)
|
void |
setTimeProvider(JwtTimeProvider timeProvider) |
boolean |
verify(com.nimbusds.jose.jwk.RSAKey signingKey,
com.nimbusds.jose.jwk.RSAKey secretKey,
String token,
boolean checkExpiry)
Verify the validity of JWT
|
public SignedWithRsaAndEncryptedWithRsaJWTRepository()
public String issueJwt(com.nimbusds.jose.jwk.RSAKey signingKey, com.nimbusds.jose.jwk.RSAKey secretKey, String jwtId, String subject, String issuer, String audience, String roles, String permissions, String algorithm, long period) throws JwtException
issueJwt 在接口中 JwtKeyPairRepository<com.nimbusds.jose.jwk.RSAKey,com.nimbusds.jose.jwk.RSAKey>signingKey - : Signing keysecretKey - : Encryption keyjwtId - : Jwt Idsubject - : Jwt Subjectissuer - : Jwt Issueraudience - : Jwt Audienceroles - : The Rolespermissions - : The Permsalgorithm - : Supported algorithms:
RS256 - RSA PKCS#1 signature with SHA-256
RS384 - RSA PKCS#1 signature with SHA-384
RS512 - RSA PKCS#1 signature with SHA-512
PS256 - RSA PSS signature with SHA-256
PS384 - RSA PSS signature with SHA-384
PS512 - RSA PSS signature with SHA-512
period - : Jwt Expiration CycleJwtException - When Authentication Exceptionpublic String issueJwt(com.nimbusds.jose.jwk.RSAKey signingKey, com.nimbusds.jose.jwk.RSAKey secretKey, String jwtId, String subject, String issuer, String audience, Map<String,Object> claims, String algorithm, long period) throws JwtException
issueJwt 在接口中 JwtKeyPairRepository<com.nimbusds.jose.jwk.RSAKey,com.nimbusds.jose.jwk.RSAKey>signingKey - : Signing keysecretKey - : Encryption keyjwtId - : Jwt Idsubject - : Jwt Subjectissuer - : Jwt Issueraudience - : Jwt Audienceclaims - : Jwt Claimsalgorithm - : Supported algorithms:
RS256 - RSA PKCS#1 signature with SHA-256
RS384 - RSA PKCS#1 signature with SHA-384
RS512 - RSA PKCS#1 signature with SHA-512
PS256 - RSA PSS signature with SHA-256
PS384 - RSA PSS signature with SHA-384
PS512 - RSA PSS signature with SHA-512
period - : Jwt Expiration CycleJwtException - When Authentication Exceptionpublic boolean verify(com.nimbusds.jose.jwk.RSAKey signingKey,
com.nimbusds.jose.jwk.RSAKey secretKey,
String token,
boolean checkExpiry)
throws JwtException
verify 在接口中 JwtKeyPairRepository<com.nimbusds.jose.jwk.RSAKey,com.nimbusds.jose.jwk.RSAKey>signingKey - :
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.
secretKey - :
If the jws was encrypted with a SecretKey, the same SecretKey should be specified on the JwtParser.
If the jws was encrypted 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.JwtException - When Authentication Exceptionpublic JwtPayload getPlayload(com.nimbusds.jose.jwk.RSAKey signingKey, com.nimbusds.jose.jwk.RSAKey secretKey, String token, boolean checkExpiry) throws JwtException
getPlayload 在接口中 JwtKeyPairRepository<com.nimbusds.jose.jwk.RSAKey,com.nimbusds.jose.jwk.RSAKey>signingKey - :
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.
secretKey - :
If the jws was encrypted with a SecretKey, the same SecretKey should be specified on the JwtParser.
If the jws was encrypted 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.JwtPayloadJwtException - When Authentication Exceptionpublic JwtTimeProvider getTimeProvider()
public void setTimeProvider(JwtTimeProvider timeProvider)
Copyright © 2019. All rights reserved.