Class JwtUtil
- java.lang.Object
-
- de.trustable.ca3s.core.service.util.JwtUtil
-
@Service public class JwtUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description JwtUtil()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jose4j.jwt.consumer.JwtContextconvertCompact(String compactJwsSerialization)longgetAccountIdForKid(String kid)AccountRequestgetAccountRequest(org.jose4j.jwt.JwtClaims jwtClaims)StringgetAccountResponseAsJSON(AccountResponse accountResponse)ChangeKeyRequestgetChangeKeyRequest(org.jose4j.jwt.JwtClaims jwtClaims)FinalizeRequestgetFinalizeReq(org.jose4j.jwt.JwtClaims jwtClaims)IdentifiersResponsegetIdentifiers(org.jose4j.jwt.JwtClaims jwtClaims)org.jose4j.jwx.JsonWebStructuregetJsonWebStructure(org.jose4j.jwt.consumer.JwtContext context)StringgetJWKThumbPrint(PublicKey newPK)StringgetKid(org.jose4j.jwx.JsonWebStructure webStruct)NewOrderRequestgetNewOrderRequest(org.jose4j.jwt.JwtClaims jwtClaims)StringgetNonce(org.jose4j.jwx.JsonWebStructure webStruct)StringgetOrderResponseAsJSON(NewOrderResponse newOrderResp)StringgetOrderResponseAsJSON(OrderResponse orderResp)PublicKeygetPublicKey(org.jose4j.jwx.JsonWebStructure webStruct)RevokeRequestgetRevokeReq(org.jose4j.jwt.JwtClaims jwtClaims)org.jose4j.jwt.consumer.JwtContextprocessCompactJWT(String compactJwsSerialization)org.jose4j.jwt.consumer.JwtContextprocessFlattenedJWT(String flattenedJwsJson)voidvalidateSignature(org.jose4j.jwt.consumer.JwtContext context, String publicKeyBase64, long accountId)voidverifyJWT(org.jose4j.jwt.consumer.JwtContext context, PublicKey publicKey)
-
-
-
Field Detail
-
KID
public static final String KID
- See Also:
- Constant Field Values
-
NONCE
public static final String NONCE
- See Also:
- Constant Field Values
-
JWK
public static final String JWK
- See Also:
- Constant Field Values
-
-
Method Detail
-
processFlattenedJWT
public org.jose4j.jwt.consumer.JwtContext processFlattenedJWT(String flattenedJwsJson)
-
processCompactJWT
public org.jose4j.jwt.consumer.JwtContext processCompactJWT(String compactJwsSerialization)
-
convertCompact
public org.jose4j.jwt.consumer.JwtContext convertCompact(String compactJwsSerialization) throws org.jose4j.jwt.consumer.InvalidJwtException
- Throws:
org.jose4j.jwt.consumer.InvalidJwtException
-
validateSignature
public void validateSignature(org.jose4j.jwt.consumer.JwtContext context, String publicKeyBase64, long accountId) throws org.jose4j.jwt.consumer.InvalidJwtException, org.jose4j.lang.JoseException, IOException- Throws:
org.jose4j.jwt.consumer.InvalidJwtExceptionorg.jose4j.lang.JoseExceptionIOException
-
verifyJWT
public void verifyJWT(org.jose4j.jwt.consumer.JwtContext context, PublicKey publicKey)
-
getAccountRequest
public AccountRequest getAccountRequest(org.jose4j.jwt.JwtClaims jwtClaims)
-
getAccountResponseAsJSON
public String getAccountResponseAsJSON(AccountResponse accountResponse)
-
getOrderResponseAsJSON
public String getOrderResponseAsJSON(NewOrderResponse newOrderResp)
-
getOrderResponseAsJSON
public String getOrderResponseAsJSON(OrderResponse orderResp)
-
getChangeKeyRequest
public ChangeKeyRequest getChangeKeyRequest(org.jose4j.jwt.JwtClaims jwtClaims)
-
getNewOrderRequest
public NewOrderRequest getNewOrderRequest(org.jose4j.jwt.JwtClaims jwtClaims)
-
getIdentifiers
public IdentifiersResponse getIdentifiers(org.jose4j.jwt.JwtClaims jwtClaims)
-
getFinalizeReq
public FinalizeRequest getFinalizeReq(org.jose4j.jwt.JwtClaims jwtClaims)
-
getRevokeReq
public RevokeRequest getRevokeReq(org.jose4j.jwt.JwtClaims jwtClaims)
-
getJsonWebStructure
public org.jose4j.jwx.JsonWebStructure getJsonWebStructure(org.jose4j.jwt.consumer.JwtContext context)
-
getAccountIdForKid
public long getAccountIdForKid(String kid)
-
getPublicKey
public PublicKey getPublicKey(org.jose4j.jwx.JsonWebStructure webStruct)
-
getKid
public String getKid(org.jose4j.jwx.JsonWebStructure webStruct) throws org.jose4j.lang.JoseException
- Throws:
org.jose4j.lang.JoseException
-
getNonce
public String getNonce(org.jose4j.jwx.JsonWebStructure webStruct) throws org.jose4j.lang.JoseException
- Throws:
org.jose4j.lang.JoseException
-
-