Class JWSValidator
java.lang.Object
de.christofreichardt.json.websignature.JWSBase
de.christofreichardt.json.websignature.JWSValidator
- All Implemented Interfaces:
de.christofreichardt.diagnosis.Traceable
Low level class for the validating JSON web signatures. Subject to change. Do not use. The preferred entry point is the Fluent API.
- Author:
- Christof Reichardt
-
Constructor Summary
ConstructorsConstructorDescriptionJWSValidator(JWSCompactSerialization compactSerialization) Creates aJWSValidatorby taking a JWS compact serialization as input. -
Method Summary
Modifier and TypeMethodDescriptionde.christofreichardt.diagnosis.AbstractTracerbooleanValidates the JSON web signature by using the givenKey.Methods inherited from class JWSBase
decodeToBytes, encode, encode, getJoseHeader, getPayload, getStrJoseHeader, getStrPayload
-
Constructor Details
-
JWSValidator
Creates aJWSValidatorby taking a JWS compact serialization as input.- Parameters:
compactSerialization- the to be validated JWS compact serialization
-
-
Method Details
-
validate
Validates the JSON web signature by using the givenKey. In the event of assymetric algorithms (indicated by the JOSE header) this MUST be aPublicKeywhereas symmetric algorithms require aSecretKey.- Parameters:
key- the to usedKey- Returns:
- indicates if the signature is valid
- Throws:
GeneralSecurityException- indicates that a problem occured during the signing process
-
getCurrentTracer
public de.christofreichardt.diagnosis.AbstractTracer getCurrentTracer()- Specified by:
getCurrentTracerin interfacede.christofreichardt.diagnosis.Traceable
-