Package de.adorsys.sdjwt
Class SdJwtUtils
- java.lang.Object
-
- de.adorsys.sdjwt.SdJwtUtils
-
public class SdJwtUtils extends Object
- Author:
- Francis Pouatcha
-
-
Field Summary
Fields Modifier and Type Field Description static booleanarrayEltSpacedstatic com.fasterxml.jackson.databind.ObjectMappermapper
-
Constructor Summary
Constructors Constructor Description SdJwtUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.fasterxml.jackson.databind.node.ArrayNodedecodeDisclosureString(String disclosure)static byte[]decodeNoPad(String encoded)static StringencodeNoPad(byte[] bytes)static byte[]hash(byte[] bytes, String hashAlg)static StringhashAndBase64EncodeNoPad(byte[] disclosureBytes, String hashAlg)static StringprintJsonArray(Object[] array)static byte[]randomBytes(int size)static StringrandomSalt()static StringreadClaim(com.fasterxml.jackson.databind.JsonNode payload, String claimName)static longreadTimeClaim(com.fasterxml.jackson.databind.JsonNode payload, String claimName)static StringrequireNonEmpty(String str, String message)
-
-
-
Method Detail
-
encodeNoPad
public static String encodeNoPad(byte[] bytes)
-
decodeNoPad
public static byte[] decodeNoPad(String encoded)
-
hashAndBase64EncodeNoPad
public static String hashAndBase64EncodeNoPad(byte[] disclosureBytes, String hashAlg)
-
randomSalt
public static String randomSalt()
-
randomBytes
public static byte[] randomBytes(int size)
-
printJsonArray
public static String printJsonArray(Object[] array) throws com.fasterxml.jackson.core.JsonProcessingException
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
hash
public static byte[] hash(byte[] bytes, String hashAlg)
-
decodeDisclosureString
public static com.fasterxml.jackson.databind.node.ArrayNode decodeDisclosureString(String disclosure) throws SdJwtVerificationException
- Throws:
SdJwtVerificationException
-
readTimeClaim
public static long readTimeClaim(com.fasterxml.jackson.databind.JsonNode payload, String claimName) throws SdJwtVerificationException- Throws:
SdJwtVerificationException
-
readClaim
public static String readClaim(com.fasterxml.jackson.databind.JsonNode payload, String claimName) throws SdJwtVerificationException
- Throws:
SdJwtVerificationException
-
-