code: public static AuthRequest createAuthRequest (
              Credentials creds, String version, String[] bootGroups, boolean requireSecureAuth,
              PublicKeyCredentials pkcreds, SecureResponse resp)
      {
          byte[] secret = resp == null ? null : resp.getCodeBytes(pkcreds);
          if (pkcreds == null || secret == null) {
              return new AuthRequest(requireSecureAuth ? null : creds, version, bootGroups);
          }
          return new AESAuthRequest(secret, creds, version, bootGroups);
      }
docs: Creates an auth request, secured if able, unsecured if not.