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 TypeMethodDescriptionorg.everit.json.schema.Schema
Returns a JWS Protected Header SchemaReturns a map of definition objects used for JWS Protected Header validationabstract org.json.JSONObject
Loads JSON schema for a JSON Protected Header validationorg.everit.json.schema.Schema
Returns a JWS Schema for a root signature element validationReturns a map of definition objects used for JWS validationabstract org.json.JSONObject
Returns a JSON schema for a root JWS element validationorg.everit.json.schema.Schema
Returns a JWS Protected Header SchemaReturns a map of definition objects used for JWS Unprotected Header validationabstract org.json.JSONObject
Loads JSON schema for a JSON Unprotected Header validationorg.everit.json.schema.Schema
loadSchema
(org.json.JSONObject schemaJSON, Map<URI, org.json.JSONObject> definitions) Loads schema with the given list of definitions (references)org.json.JSONObject
parseJson
(InputStream inputStream) Parses the JSON InputStream and returns aJSONObject
org.json.JSONObject
Parses the JSON string and returns aJSONObject
Validates a "protected" header of a JWSvalidateAgainstJWSProtectedHeaderSchema
(String jsonString) Validates a "protected" header of a JWSvalidateAgainstJWSProtectedHeaderSchema
(org.json.JSONObject json) Validates a "protected" header of a JWSValidates a JSON against JWS Schema according to RFC 7515validateAgainstJWSSchema
(String jsonString) Validates a JSON against JWS Schema according to RFC 7515validateAgainstJWSSchema
(org.json.JSONObject json) Validates a JSON against JWS Schema according to RFC 7515Validates an unprotected "header" of a JWSvalidateAgainstJWSUnprotectedHeaderSchema
(String jsonString) Validates an unprotected "header" of a JWSvalidateAgainstJWSUnprotectedHeaderSchema
(org.json.JSONObject json) Validates an unprotected "header" of a JWSvalidateAgainstSchema
(org.json.JSONObject json, org.everit.json.schema.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 org.everit.json.schema.Schema getJWSSchema()Returns a JWS Schema for a root signature element validation- Returns:
Schema
for JWS root validation
-
getJWSProtectedHeaderSchema
public org.everit.json.schema.Schema getJWSProtectedHeaderSchema()Returns a JWS Protected Header Schema- Returns:
Schema
for JWS Protected Header validation
-
getJWSUnprotectedHeaderSchema
public org.everit.json.schema.Schema getJWSUnprotectedHeaderSchema()Returns a JWS Protected Header Schema- Returns:
Schema
for JWS Protected Header validation
-
getJWSSchemaJSON
public abstract org.json.JSONObject getJWSSchemaJSON()Returns a JSON schema for a root JWS element validation- Returns:
JSONObject
-
getJWSSchemaDefinitions
Returns a map of definition objects used for JWS validation- Returns:
- JWS schema definitions map
-
getJWSProtectedHeaderSchemaJSON
public abstract org.json.JSONObject getJWSProtectedHeaderSchemaJSON()Loads JSON schema for a JSON Protected Header validation- Returns:
JSONObject
-
getJWSProtectedHeaderSchemaDefinitions
Returns a map of definition objects used for JWS Protected Header validation- Returns:
- JWS Protected Header schema definitions map
-
getJWSUnprotectedHeaderSchemaJSON
public abstract org.json.JSONObject getJWSUnprotectedHeaderSchemaJSON()Loads JSON schema for a JSON Unprotected Header validation- Returns:
JSONObject
-
getJWSUnprotectedHeaderSchemaDefinitions
Returns a map of definition objects used for JWS Unprotected Header validation- Returns:
- JWS Unprotected Header schema definitions map
-
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
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
Validates an unprotected "header" of a JWS- Parameters:
json
-JSONObject
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(org.json.JSONObject json, org.everit.json.schema.Schema schema) Validates ajson
against the provided JSONschema
- Parameters:
json
-JSONObject
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
-
parseJson
Parses the JSON string and returns aJSONObject
- Parameters:
json
-String
to parse- Returns:
JSONObject
-
parseJson
Parses the JSON InputStream and returns aJSONObject
- Parameters:
inputStream
-InputStream
to parse- Returns:
JSONObject
-
loadSchema
public org.everit.json.schema.Schema loadSchema(org.json.JSONObject schemaJSON, Map<URI, org.json.JSONObject> definitions) Loads schema with the given list of definitions (references)- Parameters:
schemaJSON
-JSONObject
the schema objectdefinitions
- a map containing definitions and their reference names- Returns:
Schema
-