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
ModifierConstructorDescriptionprotected
Default constructor instantiating the object with null values -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of RFC 7515 and RFC 7517 definitionscom.github.erosb.jsonsKema.Schema
Returns a JWS Protected Header SchemaReturns a map of definition objects used for JWS Protected Header validationabstract String
Loads JSON schema for a JSON Protected Header validationcom.github.erosb.jsonsKema.Schema
Returns a JWS Schema for a root signature element validationReturns a map of definition objects used for JWS validationabstract String
Returns a JSON schema for a root JWS element validationcom.github.erosb.jsonsKema.Schema
Returns a JWS Protected Header SchemaReturns a map of definition objects used for JWS Unprotected Header validationabstract String
Loads JSON schema for a JSON Unprotected Header validationcom.github.erosb.jsonsKema.Schema
loadSchema
(String schemaJSON, Map<URI, String> definitions) Loads schema with the given list of definitions (references)com.github.erosb.jsonsKema.JsonObject
parseJson
(InputStream inputStream) Parses the JSON InputStream and returns aJsonObject
com.github.erosb.jsonsKema.JsonObject
parseJson
(InputStream inputStream, URI uri) Parses the JSON InputStream with the provided schemauri
identifier, and returns aJsonObject
.com.github.erosb.jsonsKema.JsonObject
Parses the JSON string and returns aJsonObject
com.github.erosb.jsonsKema.JsonObject
Parses the JSON string with the provided schemauri
identifier, 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 ajson
against 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:
Schema
for JWS root validation
-
getJWSProtectedHeaderSchema
public com.github.erosb.jsonsKema.Schema getJWSProtectedHeaderSchema()Returns a JWS Protected Header Schema- Returns:
Schema
for JWS Protected Header validation
-
getJWSUnprotectedHeaderSchema
public com.github.erosb.jsonsKema.Schema getJWSUnprotectedHeaderSchema()Returns a JWS Protected Header Schema- Returns:
Schema
for JWS Protected Header validation
-
getJWSSchemaJSON
-
getJWSSchemaDefinitions
-
getJWSProtectedHeaderSchemaJSON
-
getJWSProtectedHeaderSchemaDefinitions
-
getJWSUnprotectedHeaderSchemaJSON
-
getJWSUnprotectedHeaderSchemaDefinitions
-
validateAgainstJWSSchema
Validates a JSON against JWS Schema according to RFC 7515- Parameters:
is
-InputStream
representing a JSON to validate- Returns:
- a list of
String
messages 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
-JsonObject
representing a JSON to validate- Returns:
- a list of
String
messages containing errors occurred during the validation process, empty list when validation succeeds
-
validateAgainstJWSProtectedHeaderSchema
Validates a "protected" header of a JWS- Parameters:
is
-InputStream
representing a protected header of a JWS- Returns:
- a list of
String
messages 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
-JsonObject
representing a protected header of a JWS- Returns:
- a list of
String
messages containing errors occurred during the validation process, empty list when validation succeeds
-
validateAgainstJWSUnprotectedHeaderSchema
Validates an unprotected "header" of a JWS- Parameters:
is
-InputStream
representing an unprotected header of a JWS- Returns:
- a list of
String
messages 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
-JsonValue
representing an unprotected header of a JWS- Returns:
- a list of
String
messages 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 ajson
against the provided JSONschema
- Parameters:
json
-JsonValue
to be validated against a schemaschema
-Schema
schema to validate against- Returns:
- a list of
String
messages 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
-InputStream
to parse- Returns:
JsonObject
-
parseJson
Parses the JSON InputStream with the provided schemauri
identifier, and returns aJsonObject
. This method is used for a schema parsing.- Parameters:
inputStream
-InputStream
to parseuri
-URI
of the schema- Returns:
JsonObject
-
loadSchema
Loads schema with the given list of definitions (references)- Parameters:
schemaJSON
-JsonObject
the schema object URIdefinitions
- a map containing definitions and their reference names- Returns:
Schema
-