public Properties getDisallowedCredentials(final OperationCode[] opCodes,
      final String[] regionNames, final int index) {
    // This may not be very correct since we use the value of
    // getNumPrincipalTries() but is used to avoid adding another method.
    // Also something like getNumDisallowedPrincipals() will be normally always
    // infinite, and the number here is just to perform some number of tries
    // before giving up.

    int numTries = getNumPrincipalTries(opCodes, regionNames);
    if (numTries <= 0) {
      numTries = 1;
    }

    for (int tries = 0; tries < numTries; tries++) {
      final Principal principal =
          getDisallowedPrincipal(opCodes, regionNames, (index + tries) % numTries);
      try {
        return generator.getValidCredentials(principal);
      } catch (IllegalArgumentException ignored) {
      }
    }
    return null;
  }
Get a set of credentials generated using the given index not allowed to perform the given
{@link OperationCode}s for the given regions. The credentials are required to be valid for
authentication.

@param opCodes the {@link OperationCode}s of the operations requiring authorization failure;
       should not be null
@param regionNames list of the region names requiring authorization failure; a value of null
       indicates all regions
@param index used to generate multiple such credentials by passing different values for this

@return the set of credentials that are not authorized to perform the given operation in the
        given region
geode-dunit/src/main/java/org/apache/geode/security/generator/AuthzCredentialGenerator.java