Package org.europa.together.application
Class NimbusJwt
java.lang.Object
org.europa.together.application.NimbusJwt
- All Implemented Interfaces:
JsonWebToken
Implementation of JSON Web Token.
-
Field Summary
Fields inherited from interface org.europa.together.business.JsonWebToken
CONFIG_SET, CONFIG_VERSION, FEATURE_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildHMAC512SignedJws(String jsonPayload) JSON Web Signature (JWS) represents content secured with digital signatures or Message Authentication Codes (MACs) using JSON-based data structures.buildHMAC512SignedJwt(String issuer, String subject, List<String> audience) Create a JSON Web Token.buildHMAC512SignedJwt(List<String> audience) Create a JSON Web Token.Parse a JWS String and validate the signature.Parse a JWT String and validate the signature.
-
Constructor Details
-
NimbusJwt
Constructor.- Throws:
DAOException- case of error
-
-
Method Details
-
buildHMAC512SignedJws
Description copied from interface:JsonWebTokenJSON Web Signature (JWS) represents content secured with digital signatures or Message Authentication Codes (MACs) using JSON-based data structures. Cryptographic algorithms and identifiers for use with this specification are described in the separate JSON Web Algorithms (JWA) specification and an IANA registry defined by that specification. Related encryption capabilities are described in the separate JSON Web Encryption (JWE) specification.- Specified by:
buildHMAC512SignedJwsin interfaceJsonWebToken- Parameters:
jsonPayload- as String- Returns:
- JWS as String
- Throws:
JsonProcessingException- case of error
-
buildHMAC512SignedJwt
public String buildHMAC512SignedJwt(String issuer, String subject, List<String> audience) throws JsonProcessingException Description copied from interface:JsonWebTokenCreate a JSON Web Token. JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties. The claims in a JWT are encoded as a JSON object that is used as the payload of a JSON Web Signature (JWS) structure or as the plaintext of a JSON Web Encryption (JWE) structure, enabling the claims to be digitally signed or integrity protected with a Message Authentication Code (MAC) and/or encrypted.- Specified by:
buildHMAC512SignedJwtin interfaceJsonWebToken- Parameters:
issuer- as Stringsubject- as Stringaudience- as List of Strings- Returns:
- JWT as String
- Throws:
JsonProcessingException- case of error
-
buildHMAC512SignedJwt
Description copied from interface:JsonWebTokenCreate a JSON Web Token. JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties. The claims in a JWT are encoded as a JSON object that is used as the payload of a JSON Web Signature (JWS) structure or as the plaintext of a JSON Web Encryption (JWE) structure, enabling the claims to be digitally signed or integrity protected with a Message Authentication Code (MAC) and/or encrypted. issuer and subject get fetched from DB entries.- Specified by:
buildHMAC512SignedJwtin interfaceJsonWebToken- Parameters:
audience- as List of Strings- Returns:
- JWT as String
- Throws:
JsonProcessingException- case of error
-
parseHMAC512SingedJws
Description copied from interface:JsonWebTokenParse a JWS String and validate the signature. If the siganture is invalid it throws an JsonProcessingException.- Specified by:
parseHMAC512SingedJwsin interfaceJsonWebToken- Parameters:
jws- as String- Returns:
- encoded JWS as String
- Throws:
JsonProcessingException- case of error
-
parseHMAC512SingedJwt
Description copied from interface:JsonWebTokenParse a JWT String and validate the signature. If the siganture is invalid it throws an JsonProcessingException.- Specified by:
parseHMAC512SingedJwtin interfaceJsonWebToken- Parameters:
jwt- as String- Returns:
- encoded JWT as String
- Throws:
JsonProcessingException- case of error
-