Class ChallengeResponse

All Implemented Interfaces:
Cloneable

public class ChallengeResponse extends AbstractResponse
Object used to represent a challenge sent to a user asking for proof of their identity. The challenge includes a nonce (a random unpredictable set of bytes) as well as a digest of the request that is being challenged (so that the user can verify that they are only authorizing a specific operation).
  • Field Details

    • nonce

      public byte[] nonce
  • Constructor Details

    • ChallengeResponse

      public ChallengeResponse(int opCode, byte[] nonce)
      Construct a challenge to the specified request. This constructor is used on the client side, when decoding messages.
    • ChallengeResponse

      public ChallengeResponse(AbstractRequest req) throws HandleException
      Construct a challenge to the specified request. This constructor is used on the server side.
      Throws:
      HandleException
    • ChallengeResponse

      public ChallengeResponse(AbstractRequest req, boolean compatibility) throws HandleException
      Construct a challenge to the specified request. The compatibility parameter should be set to true when this challenge response is being created artificially to check a secret key.
      Throws:
      HandleException
  • Method Details

    • initializeRandom

      public static final void initializeRandom()
    • initializeRandom

      public static final void initializeRandom(byte[] seed)
    • generateNonce

      public static byte[] generateNonce()
      Generate a nonce.