public interface JWE
JWE
represents a parsed JWE (JSON Web Encryption) Object.
JWE represents encrypted content using JSON data structures and base64url encoding. The representation consists of three parts: the JWE Header, the JWE Encrypted Key, and the JWE Cipher text. The three parts are base64url-encoded for transmission, and typically represented as the concatenation of the encoded strings in that order, with the three strings being separated by period (".") characters.
Header Section
The header consist of information relating to:
{ "enc": "A256GCM", "alg": "dir" }
Payload
The payload contains the data for the JWT. Using the JWTBuilder
to generate a JWT object and
An example payload:
{ "iss": "https://server.ebasetech.com", "aud": "https://client.ebasetech.com", "name": "John Doe" }
The following show an example Base64url encoding the bytes of the UTF-8 representation of the JWE Header yields this Encoded JWE Header value:
eyJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiZGlyIn0..hcdXZsbP6P0Xr8QR.ND3QbFqwUOXoRl4KMjOMkYUoPGQBRK10KlZHjXSup94nQsyi-1xFYplsctFygbG9GvDTxouONQWUlxkTfl3YoI5rqTPeNU4SoRQyPMCRpDBZQLWqfWlEd8lIDCynFxMt1xLYbmROS8XiFOkDdnY6vtoy7sVu.Xt9BZQazg6MlhNjK26UvCQ
JWTManager.parseJWE(String, javax.crypto.SecretKey)
Modifier and Type | Method and Description |
---|---|
JWEHeader |
getHeader()
Returns the header for the JWS
|
java.lang.String |
getPayload() |
JWT |
getPlainJWT()
Returns the Payload of the JWE as a JWT Object
|
java.lang.String getPayload() throws com.ebasetech.ufs.runtime.security.jwt.InvalidJWTokenException
com.ebasetech.ufs.runtime.security.jwt.InvalidJWTokenException
- thrown if the payload is invalidJWEHeader getHeader() throws com.ebasetech.ufs.runtime.security.jwt.InvalidJWTokenException
com.ebasetech.ufs.runtime.security.jwt.InvalidJWTokenException
- thrown if the header is invalidJWT getPlainJWT() throws com.ebasetech.ufs.runtime.security.jwt.InvalidJWTokenException
com.ebasetech.ufs.runtime.security.jwt.InvalidJWTokenException
- thrown payload is invalid