Class JWSValidator

java.lang.Object
de.christofreichardt.json.websignature.JWSBase
de.christofreichardt.json.websignature.JWSValidator
All Implemented Interfaces:
de.christofreichardt.diagnosis.Traceable

public class JWSValidator extends JWSBase implements 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 Details

    • JWSValidator

      public JWSValidator(JWSCompactSerialization compactSerialization)
      Creates a JWSValidator by taking a JWS compact serialization as input.
      Parameters:
      compactSerialization - the to be validated JWS compact serialization
  • Method Details

    • validate

      public boolean validate(Key key) throws GeneralSecurityException
      Validates the JSON web signature by using the given Key. In the event of assymetric algorithms (indicated by the JOSE header) this MUST be a PublicKey whereas symmetric algorithms require a SecretKey.
      Parameters:
      key - the to used Key
      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:
      getCurrentTracer in interface de.christofreichardt.diagnosis.Traceable