public Properties getAllowedCredentials(final OperationCode[] opCodes, final String[] regionNames,
      final int index) {
    int numTries = getNumPrincipalTries(opCodes, regionNames);
    if (numTries <= 0) {
      numTries = 1;
    }

    for (int tries = 0; tries < numTries; tries++) {
      final Principal principal =
          getAllowedPrincipal(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 allowed to perform the given
{@link OperationCode}s for the given regions.

@param opCodes the list of {@link OperationCode}s of the operations requiring authorization;
       should not be null
@param regionNames list of the region names requiring authorization; 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 authorized to perform the given operation in the given regions
geode-dunit/src/main/java/org/apache/geode/security/generator/AuthzCredentialGenerator.java