Top Inners Fields Constructors Methods
org.keycloak.sdjwt

public Class SdJwtUtils

extends Object
Class Inheritance
Imports
java.io.IOException, java.security.SecureRandom, java.util.Optional, org.keycloak.common.util.Base64Url, org.keycloak.jose.jws.crypto.HashUtils, com.fasterxml.jackson.core.JsonGenerator, .JsonProcessingException, com.fasterxml.jackson.core.util.MinimalPrettyPrinter, com.fasterxml.jackson.databind.ObjectMapper, .ObjectWriter

Author
Francis Pouatcha

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
public static boolean
pack-priv static SdJwtUtils.ArraySpacedPrettyPrinter
public static final ObjectMapper
private static SecureRandom

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String
encodeNoPad(byte[] bytes)

public static String
hashAndBase64EncodeNoPad(byte[] disclosureBytes, String hashAlg)

public static String
public static byte[]
randomBytes(int size)

public static String
public static String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

arrayEltSpacedback to summary
public static boolean arrayEltSpaced
arraySpacedPrettyPrinterback to summary
pack-priv static SdJwtUtils.ArraySpacedPrettyPrinter arraySpacedPrettyPrinter
mapperback to summary
public static final ObjectMapper mapper
RANDOMback to summary
private static SecureRandom RANDOM

Constructor Detail

SdJwtUtilsback to summary
public SdJwtUtils()

Method Detail

encodeNoPadback to summary
public static String encodeNoPad(byte[] bytes)
hashAndBase64EncodeNoPadback to summary
public static String hashAndBase64EncodeNoPad(byte[] disclosureBytes, String hashAlg)
printJsonArrayback to summary
public static String printJsonArray(Object[] array) throws JsonProcessingException
randomBytesback to summary
public static byte[] randomBytes(int size)
randomSaltback to summary
public static String randomSalt()
requireNonEmptyback to summary
public static String requireNonEmpty(String str, String message)
org.keycloak.sdjwt back to summary

pack-priv Class SdJwtUtils.ArraySpacedPrettyPrinter

extends MinimalPrettyPrinter
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final ObjectMapper
pack-priv final ObjectWriter
Inherited from com.fasterxml.jackson.core.util.MinimalPrettyPrinter:
_rootValueSeparator_separators

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
writeArrayValueSeparator(JsonGenerator
Generator used for output
jg
)

Overrides com.fasterxml.jackson.core.util.MinimalPrettyPrinter.writeArrayValueSeparator.

Implements com.fasterxml.jackson.core.PrettyPrinter.writeArrayValueSeparator.

Method called after an array value has been completely output, and before another value is to be output.
public void
writeObjectEntrySeparator(JsonGenerator
Generator used for output
jg
)

Overrides com.fasterxml.jackson.core.util.MinimalPrettyPrinter.writeObjectEntrySeparator.

Implements com.fasterxml.jackson.core.PrettyPrinter.writeObjectEntrySeparator.

Method called after an object entry (field:value) has been completely output, and before another value is to be output.
public void
writeObjectFieldValueSeparator(JsonGenerator
Generator used for output
jg
)

Overrides com.fasterxml.jackson.core.util.MinimalPrettyPrinter.writeObjectFieldValueSeparator.

Implements com.fasterxml.jackson.core.PrettyPrinter.writeObjectFieldValueSeparator.

Method called after an object field has been output, but before the value is output.
Inherited from com.fasterxml.jackson.core.util.MinimalPrettyPrinter:
beforeArrayValuesbeforeObjectEntriessetRootValueSeparatorsetSeparatorswriteEndArraywriteEndObjectwriteRootValueSeparatorwriteStartArraywriteStartObject

Field Detail

prettyPrinObjectMapperback to summary
pack-priv final ObjectMapper prettyPrinObjectMapper
writerback to summary
pack-priv final ObjectWriter writer

Constructor Detail

ArraySpacedPrettyPrinterback to summary
public ArraySpacedPrettyPrinter()

Method Detail

writeArrayValueSeparatorback to summary
public void writeArrayValueSeparator(JsonGenerator jg) throws IOException

Overrides com.fasterxml.jackson.core.util.MinimalPrettyPrinter.writeArrayValueSeparator.

Implements com.fasterxml.jackson.core.PrettyPrinter.writeArrayValueSeparator.

Doc from com.fasterxml.jackson.core.util.MinimalPrettyPrinter.writeArrayValueSeparator.

Method called after an array value has been completely output, and before another value is to be output.

Default handling (without pretty-printing) will output a single comma to separate values.

Parameters
jg:JsonGenerator

Doc from com.fasterxml.jackson.core.PrettyPrinter.writeArrayValueSeparator.

Generator used for output

Annotations
@Override
Exceptions
IOException:

Doc from com.fasterxml.jackson.core.PrettyPrinter.writeArrayValueSeparator.

if there is either an underlying I/O problem or encoding issue at format layer

writeObjectEntrySeparatorback to summary
public void writeObjectEntrySeparator(JsonGenerator jg) throws IOException

Overrides com.fasterxml.jackson.core.util.MinimalPrettyPrinter.writeObjectEntrySeparator.

Implements com.fasterxml.jackson.core.PrettyPrinter.writeObjectEntrySeparator.

Doc from com.fasterxml.jackson.core.util.MinimalPrettyPrinter.writeObjectEntrySeparator.

Method called after an object entry (field:value) has been completely output, and before another value is to be output.

Default handling (without pretty-printing) will output a single comma to separate the two.

Parameters
jg:JsonGenerator

Doc from com.fasterxml.jackson.core.PrettyPrinter.writeObjectEntrySeparator.

Generator used for output

Annotations
@Override
Exceptions
IOException:

Doc from com.fasterxml.jackson.core.PrettyPrinter.writeObjectEntrySeparator.

if there is either an underlying I/O problem or encoding issue at format layer

writeObjectFieldValueSeparatorback to summary
public void writeObjectFieldValueSeparator(JsonGenerator jg) throws IOException

Overrides com.fasterxml.jackson.core.util.MinimalPrettyPrinter.writeObjectFieldValueSeparator.

Implements com.fasterxml.jackson.core.PrettyPrinter.writeObjectFieldValueSeparator.

Doc from com.fasterxml.jackson.core.util.MinimalPrettyPrinter.writeObjectFieldValueSeparator.

Method called after an object field has been output, but before the value is output.

Default handling will just output a single colon to separate the two, without additional spaces.

Parameters
jg:JsonGenerator

Doc from com.fasterxml.jackson.core.PrettyPrinter.writeObjectFieldValueSeparator.

Generator used for output

Annotations
@Override
Exceptions
IOException:

Doc from com.fasterxml.jackson.core.PrettyPrinter.writeObjectFieldValueSeparator.

if there is either an underlying I/O problem or encoding issue at format layer