Class JWSBase
java.lang.Object
de.christofreichardt.json.websignature.JWSBase
- Direct Known Subclasses:
JWSSigner, JWSValidator
This class provides some core functionality related to creating and validating signatures.
- Author:
- Christof Reichardt
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]decodeToBytes(String input) Decodes a Base64-URL-encoded string into bytes.static Stringencode(byte[] input) Encodes the giveninputusing the base64-url-encoding scheme.static StringEncodes the giveninputby first taking its UTF-8 encoded bytes and next using the base64-url-encoding scheme.jakarta.json.JsonObjectReturns the JOSE Header asJsonObject.jakarta.json.JsonStructureReturns the payload asJsonObject.Returns the string representation of the JOSE header.Returns the string representation of the actual payload.
-
Method Details
-
encode
-
encode
Encodes the giveninputusing the base64-url-encoding scheme.- Parameters:
input- the to be encoded bytes- Returns:
- the resulting base64-url-encoded
String
-
decodeToBytes
Decodes a Base64-URL-encoded string into bytes.- Parameters:
input- the Base64-URL-encoded string- Returns:
- the decoded bytes
-
getStrJoseHeader
Returns the string representation of the JOSE header. The raw bytes used for creating the signature will be derived from this string.- Returns:
- the string representation of the JOSE header.
-
getJoseHeader
public jakarta.json.JsonObject getJoseHeader()Returns the JOSE Header asJsonObject.- Returns:
- the JOSE Header as
JsonObject.
-
getStrPayload
Returns the string representation of the actual payload. The raw bytes used for creating the signature will be derived from this string.- Returns:
- the string representation of the actual payload.
-
getPayload
public jakarta.json.JsonStructure getPayload()Returns the payload asJsonObject.- Returns:
- the payload as
JsonObject.
-