Class NOPSigningHandler

java.lang.Object
org.forgerock.json.jose.jws.handlers.NOPSigningHandler
All Implemented Interfaces:
SigningHandler

public class NOPSigningHandler extends Object implements SigningHandler
An implementation of the SigningHandler which does not perform any signing or verifying.
Since:
2.0.0
  • Constructor Details

  • Method Details

    • sign

      public byte[] sign(JwsAlgorithm algorithm, String data)
      Simply returns a byte array of a UTF-8 empty string.
      Specified by:
      sign in interface SigningHandler
      Parameters:
      algorithm - The JwsAlgorithm defining the Java Cryptographic algorithm.
      data - The data to be signed.
      Returns:
      A byte array of the signature.
    • sign

      public byte[] sign(JwsAlgorithm algorithm, byte[] data)
      Returns an empty byte array.
      Specified by:
      sign in interface SigningHandler
      Parameters:
      algorithm - the JWS signature algorithm to use.
      data - the raw data to sign.
      Returns:
      the signature.
    • verify

      public boolean verify(JwsAlgorithm algorithm, byte[] data, byte[] signature)
      Verifies that the signature length is zero.
      Specified by:
      verify in interface SigningHandler
      Parameters:
      algorithm - The JwsAlgorithm defining the JavaCryptographic algorithm.
      data - The data that was signed.
      signature - The signature of the data.
      Returns:
      true if the signature is a valid signature of the data.