Class ChallengeResponse

  • All Implemented Interfaces:

    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 Detail

      • nonce

        public byte[] nonce
    • Constructor Detail

      • 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,
                                 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.
    • Method Detail

      • initializeRandom

        public static final void initializeRandom()
      • initializeRandom

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

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