============================================================
 RockyGuard Library - Customer Package (Windows x64)
============================================================

This zip contains the Windows x64 build of RockyGuard. For the
Linux x64 build, download rockyguard-vX.Y.Z-linux-x64-customer.zip.
Both packages share the same C++ API and license-file format;
see docs/Customer_Documentation.txt for cross-platform coverage.

CONTENTS:

  include/rockyguard/       Public headers (verification only)
    rockyguard.h              Single-include convenience header
    version.h                 Library version macros (auto-generated)
    types.h                   Enums and result types
    license.h                 License data model
    license_verifier.h        License verification
    hardware_fingerprint.h    Machine hardware fingerprinting
    floating_client.h         Floating license client (Premium)
    export.h                  DLL export macros

  lib/static/
    rockyguard.lib          Static library, /MD (Release-CRT)
    rockyguard_mdd.lib      Static library, /MDd (Debug-CRT) -- v1.2.1+

  lib/shared/
    rockyguard.dll          Shared library (DLL)
    rockyguard.lib          Import library for DLL
    rockyguard.sig          Integrity signature (ship with DLL)
    libcrypto-3-x64.dll     OpenSSL crypto runtime (ship with DLL)
    libssl-3-x64.dll        OpenSSL TLS runtime (ship with DLL)
                            BOTH DLLs are required. rockyguard.dll
                            imports from each; shipping only libcrypto
                            fails at process start with
                            STATUS_DLL_NOT_FOUND (0xC0000135) and no
                            message. A dev machine often hides this
                            because something else on PATH supplies a
                            libssl.

  tools/
    license_keygen.exe              Generate your Ed25519/RSA keypair
    license_create.exe              Create end-user licenses
    license_verify.exe              Verify and inspect license files
    rg_fingerprint.exe              Print machine hardware fingerprint (CLI)
    rg_fingerprint_gui.exe          Same, in a GUI window with a Copy
                                    button. Hand this to end users who
                                    will double-click rather than open
                                    a terminal.
    rg_floating_server.exe     Floating license server (Premium tier only)
    floating_server_config.yaml     Sample server config file
    rg_floating_client.exe     Floating license client (Premium tier only)
    libcrypto-3-x64.dll             OpenSSL runtime for the tools above.
    libssl-3-x64.dll                Keep both next to the .exe files if
                                    you relocate them; the tools fail to
                                    start without them.

  deps/
    include/openssl/                Bundled OpenSSL headers (C++17)
    lib/libcrypto.lib               OpenSSL crypto -- link into your app
    lib/libssl.lib                  OpenSSL TLS -- link into your app

  examples/
    CMakeLists.txt                  Build script for the examples
    node_locked_example.cpp         Node-locked license verification example
    rg_floating_client.cpp     Floating license client example (Premium)

  docs/
    Customer_Documentation.txt/pdf          Library documentation
    Customer_API_Reference.txt/pdf          API reference
    RockyGuard_License_Agreement.txt/pdf    Software License Agreement

  AI_INTEGRATION_GUIDE.md                   For AI coding assistants
                                            (Claude, ChatGPT, Cursor,
                                            Copilot, Gemini, Cody, ...).
                                            Tell your AI: "Read
                                            AI_INTEGRATION_GUIDE.md and
                                            integrate RockyGuard into
                                            this project." A deterministic
                                            recipe -- CMake snippet, key
                                            embedding, verification call,
                                            feature gating -- that any
                                            modern coding agent can follow.

  portal/
    start.bat / start.ps1   Launch the licensing-management web app
    README.md               Portal setup and daily workflow
                            Drop your vendor_license.json + vendor_private.pem
                            into Settings on first run, then issue licenses
                            to your end users from a browser at 127.0.0.1:8765.
                            See portal\README.md.

QUICK START:

  BEFORE STEP 2 YOU NEED A FILE THAT IS NOT IN THIS ZIP.
  vendor_license.json is issued to your organisation by Rocky Software
  Inc. and sent by email; it is deliberately not bundled, because it is
  specific to you. Request it now if you do not have it -- the stated
  turnaround is one business day, and steps 2 onward cannot run without
  it. Details in Customer_Documentation section 2.2. Step 1 below needs
  nothing from us and can be done while you wait.

  WHERE TO RUN THESE. Work from a directory YOU own -- not this
  extracted package. The tools write their output to the current
  directory, so running them from here drops your private signing key
  inside a folder you are expected to delete and re-extract. Set a
  variable pointing back at the package once, then use it everywhere:

     PowerShell:  cd C:\licensing\myproduct
                  $RG = "<the folder this README is in>"
     cmd.exe:     cd /d C:\licensing\myproduct
                  set RG=<the folder this README is in>

  1. Generate your keypair (once):
     & "$RG\tools\license_keygen.exe" --private private.pem --public public.pem
     (cmd.exe: "%RG%\tools\license_keygen.exe" --private private.pem --public public.pem)

  2. Create end-user licenses (vendor license required, CLI tool):
       & "$RG\tools\license_create.exe" ^
         --vendor-license vendor_license.json ^
         --key private.pem --id "LIC-001" ^
         --licensee "User" --product "App" ^
         --fingerprint-value "<end user's fingerprint>" ^
         --expires "2027-12-31T23:59:59Z"

  3. In your end-user application (NO vendor license needed):
       std::optional<LicenseVerifier> v;      // not copyable/movable
       try { v.emplace(PUBLIC_KEY); }         // the ONLY call that throws
       catch (const std::runtime_error& e) {
           std::cerr << e.what() << "\n"; return 1;
       }
       auto result = v->load("license.json");
       result = v->check_node_locked();

     The try/catch is not decoration. A PUBLIC_KEY literal that was
     truncated or line-wrapped when pasted compiles fine and throws at
     construction; uncaught, that is std::terminate() on your end
     user's machine -- no message, exit 0xC0000409. See
     docs/Customer_Documentation.txt section 12.2.

LINKING:

  The fastest correct route is to copy examples/CMakeLists.txt. It
  already defines the imported targets, both OpenSSL libraries, and the
  full Windows system-library list, and it is the exact file used to
  build the shipped examples. The snippets below are the minimum
  equivalent if you would rather write it yourself.

  Static (recommended):
    In your CMakeLists.txt, with ROCKYGUARD_DIR pointing at the
    extracted package root:

      target_include_directories(your_app PRIVATE
          ${ROCKYGUARD_DIR}/include
          ${ROCKYGUARD_DIR}/deps/include)
      target_link_libraries(your_app PRIVATE
          ${ROCKYGUARD_DIR}/lib/static/rockyguard.lib
          ${ROCKYGUARD_DIR}/deps/lib/libssl.lib
          ${ROCKYGUARD_DIR}/deps/lib/libcrypto.lib
          ws2_32 iphlpapi wbemuuid ole32 oleaut32
          advapi32 shell32 crypt32)

    BOTH OpenSSL libraries are required, not libcrypto alone: the
    floating-license client and the time-anchor HTTPS check pull in
    libssl symbols (SSL_*, TLS_client_method, X509_*) on top of the
    libcrypto ones (EVP_*, HMAC_*, ASN1_*).

    If you link the Debug CRT (/MDd), use rockyguard_mdd.lib instead of
    rockyguard.lib. examples/CMakeLists.txt does this automatically via
    IMPORTED_LOCATION_DEBUG.

  Shared (DLL):
    In your CMakeLists.txt:

      target_compile_definitions(your_app PRIVATE ROCKYGUARD_SHARED_LIB)
      target_include_directories(your_app PRIVATE
          ${ROCKYGUARD_DIR}/include)
      target_link_libraries(your_app PRIVATE
          ${ROCKYGUARD_DIR}/lib/shared/rockyguard.lib)

    The import library carries the OpenSSL dependency, so you do not
    link libssl/libcrypto yourself in this configuration -- but you do
    have to SHIP their DLLs.

    Ship with your application:
      - rockyguard.dll
      - rockyguard.sig      (integrity signature; must sit next to
                             the DLL, or the integrity check fails)
      - libcrypto-3-x64.dll
      - libssl-3-x64.dll    (both; see lib/shared/ above)

PLATFORM:

  Windows 10 / Windows 11 x64, Windows Server 2019 / 2022 x64.
  Visual Studio 2019 or newer (MSVC 19.20+) to link the .lib/.dll.
  Visual Studio 2022 17.4+ recommended for C++17/20 front-end
  features used in the examples.
