Package eu.europa.esig.jws
Class AbstractJWSUtils
java.lang.Object
eu.europa.esig.jws.AbstractJWSUtils
- Direct Known Subclasses:
JAdESUtils,JWSUtils
Abstract class for JWS signature validation against JSON schemas
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor instantiating the object with null values -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of RFC 7515 and RFC 7517 definitionscom.github.erosb.jsonsKema.SchemaReturns a JWS Protected Header SchemaReturns a map of definition objects used for JWS Protected Header validationabstract StringLoads JSON schema for a JSON Protected Header validationcom.github.erosb.jsonsKema.SchemaReturns a JWS Schema for a root signature element validationReturns a map of definition objects used for JWS validationabstract StringReturns a JSON schema for a root JWS element validationcom.github.erosb.jsonsKema.SchemaReturns a JWS Protected Header SchemaReturns a map of definition objects used for JWS Unprotected Header validationabstract StringLoads JSON schema for a JSON Unprotected Header validationcom.github.erosb.jsonsKema.SchemaloadSchema(String schemaJSON, Map<URI, String> definitions) Loads schema with the given list of definitions (references)com.github.erosb.jsonsKema.JsonObjectparseJson(InputStream inputStream) Parses the JSON InputStream and returns aJsonObjectcom.github.erosb.jsonsKema.JsonObjectparseJson(InputStream inputStream, URI uri) Parses the JSON InputStream with the provided schemauriidentifier, and returns aJsonObject.com.github.erosb.jsonsKema.JsonObjectParses the JSON string and returns aJsonObjectcom.github.erosb.jsonsKema.JsonObjectParses the JSON string with the provided schemauriidentifier, and returns aJsonObject.validateAgainstJWSProtectedHeaderSchema(com.github.erosb.jsonsKema.JsonObject json) Validates a "protected" header of a JWSValidates a "protected" header of a JWSvalidateAgainstJWSProtectedHeaderSchema(String jsonString) Validates a "protected" header of a JWSvalidateAgainstJWSSchema(com.github.erosb.jsonsKema.JsonObject json) Validates a JSON against JWS Schema according to RFC 7515Validates a JSON against JWS Schema according to RFC 7515validateAgainstJWSSchema(String jsonString) Validates a JSON against JWS Schema according to RFC 7515validateAgainstJWSUnprotectedHeaderSchema(com.github.erosb.jsonsKema.JsonValue json) Validates an unprotected "header" of a JWSValidates an unprotected "header" of a JWSvalidateAgainstJWSUnprotectedHeaderSchema(String jsonString) Validates an unprotected "header" of a JWSvalidateAgainstSchema(com.github.erosb.jsonsKema.JsonValue json, com.github.erosb.jsonsKema.Schema schema) Validates ajsonagainst the provided JSONschema
-
Constructor Details
-
AbstractJWSUtils
protected AbstractJWSUtils()Default constructor instantiating the object with null values
-
-
Method Details
-
getJWSSchema
public com.github.erosb.jsonsKema.Schema getJWSSchema()Returns a JWS Schema for a root signature element validation- Returns:
Schemafor JWS root validation
-
getJWSProtectedHeaderSchema
public com.github.erosb.jsonsKema.Schema getJWSProtectedHeaderSchema()Returns a JWS Protected Header Schema- Returns:
Schemafor JWS Protected Header validation
-
getJWSUnprotectedHeaderSchema
public com.github.erosb.jsonsKema.Schema getJWSUnprotectedHeaderSchema()Returns a JWS Protected Header Schema- Returns:
Schemafor JWS Protected Header validation
-
getJWSSchemaJSON
-
getJWSSchemaDefinitions
-
getJWSProtectedHeaderSchemaJSON
-
getJWSProtectedHeaderSchemaDefinitions
-
getJWSUnprotectedHeaderSchemaJSON
-
getJWSUnprotectedHeaderSchemaDefinitions
-
validateAgainstJWSSchema
Validates a JSON against JWS Schema according to RFC 7515- Parameters:
is-InputStreamrepresenting a JSON to validate- Returns:
- a list of
Stringmessages containing errors occurred during the validation process, empty list when validation succeeds
-
validateAgainstJWSSchema
Validates a JSON against JWS Schema according to RFC 7515 -
validateAgainstJWSSchema
Validates a JSON against JWS Schema according to RFC 7515- Parameters:
json-JsonObjectrepresenting a JSON to validate- Returns:
- a list of
Stringmessages containing errors occurred during the validation process, empty list when validation succeeds
-
validateAgainstJWSProtectedHeaderSchema
Validates a "protected" header of a JWS- Parameters:
is-InputStreamrepresenting a protected header of a JWS- Returns:
- a list of
Stringmessages containing errors occurred during the validation process, empty list when validation succeeds
-
validateAgainstJWSProtectedHeaderSchema
Validates a "protected" header of a JWS -
validateAgainstJWSProtectedHeaderSchema
public List<String> validateAgainstJWSProtectedHeaderSchema(com.github.erosb.jsonsKema.JsonObject json) Validates a "protected" header of a JWS- Parameters:
json-JsonObjectrepresenting a protected header of a JWS- Returns:
- a list of
Stringmessages containing errors occurred during the validation process, empty list when validation succeeds
-
validateAgainstJWSUnprotectedHeaderSchema
Validates an unprotected "header" of a JWS- Parameters:
is-InputStreamrepresenting an unprotected header of a JWS- Returns:
- a list of
Stringmessages containing errors occurred during the validation process, empty list when validation succeeds
-
validateAgainstJWSUnprotectedHeaderSchema
Validates an unprotected "header" of a JWS -
validateAgainstJWSUnprotectedHeaderSchema
public List<String> validateAgainstJWSUnprotectedHeaderSchema(com.github.erosb.jsonsKema.JsonValue json) Validates an unprotected "header" of a JWS- Parameters:
json-JsonValuerepresenting an unprotected header of a JWS- Returns:
- a list of
Stringmessages containing errors occurred during the validation process, empty list when validation succeeds
-
validateAgainstSchema
public List<String> validateAgainstSchema(com.github.erosb.jsonsKema.JsonValue json, com.github.erosb.jsonsKema.Schema schema) Validates ajsonagainst the provided JSONschema- Parameters:
json-JsonValueto be validated against a schemaschema-Schemaschema to validate against- Returns:
- a list of
Stringmessages containing errors occurred during the validation process, empty list when validation succeeds
-
getJSONSchemaDefinitions
-
parseJson
-
parseJson
-
parseJson
Parses the JSON InputStream and returns aJsonObject- Parameters:
inputStream-InputStreamto parse- Returns:
JsonObject
-
parseJson
Parses the JSON InputStream with the provided schemauriidentifier, and returns aJsonObject. This method is used for a schema parsing.- Parameters:
inputStream-InputStreamto parseuri-URIof the schema- Returns:
JsonObject
-
loadSchema
Loads schema with the given list of definitions (references)- Parameters:
schemaJSON-JsonObjectthe schema object URIdefinitions- a map containing definitions and their reference names- Returns:
Schema
-