Cryptolens java
Skills for coding agents to add license verification to your application, implement licensing models and integrate Devolens with other services, supporting Claude Code, Codex and other agents.
npx -y skills add Cryptolens/skills --skill cryptolens-javaAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Work on the Cryptolens Java SDK and Java-specific software licensing integrations. Use when Codex needs to inspect, modify, review, test, or explain the `Cryptolens/cryptolens-java` repository, especially license key verification, key activation, get-key flows, offline license verification, offline license strings, floating licenses, trial licenses, machine binding, node-locking, user-verification integrations, license-server routing, data objects, analytics events, Maven packaging, or migration away from deprecated `io.cryptolens.legacy.*` classes.
SKILL.md
11.3 KB, as published. Nobody here has run it
Cryptolens Java
Overview
Use this skill for work in the Cryptolens Java SDK repository: github.com/Cryptolens/cryptolens-java.
Treat GitHub as the primary source of truth. If a local checkout is also available, use it as a convenience for editing and validation, but do not assume cryptolens-java/ exists on disk.
Treat src/main/java/io/cryptolens/methods and src/main/java/io/cryptolens/models as the supported API surface. Treat src/main/java/io/cryptolens/legacy as compatibility-only code: io.cryptolens.legacy.Cryptolens is explicitly @Deprecated, and new code should not import or extend anything from that package unless the task is specifically about backward compatibility.
Before adding or explaining machine-binding checks, read the shared rule in licensing-invariants.md.
Before adding or explaining floating licensing, read the shared rule in floating-licenses.md.
Before recommending offline caching or local license files, read offline-fallback.md.
If an API call returns a populated APIError.message, read the shared error table in api-error-messages.md before diagnosing the issue.
Before writing examples, troubleshooting steps, or support guidance for product workflows, read official-workflows.md so the generated guidance matches the official Cryptolens docs, not just the repository README.
Start with official-workflows.md, then repo-map.md, then java-workflows.md for current Java-specific guidance and machine-code/version choices.
Quick Start
- Classify the request: activation flow, machine-binding, offline cache, docs/examples, packaging, or legacy migration.
- Read official-workflows.md first for the product-supported flows and caveats from the docs.
- Read java-workflows.md for Java SDK specifics and deprecated boundaries.
- Read the GitHub repo README and source files named in repo-map.md.
- If a local checkout exists, compare it against GitHub only as needed for editing or validation.
- Keep code, docs, the example app, and tests aligned in the same pass when public behavior changes.
Task Guide
Activation, get-key, and offline verification
Open methods/Key.java, methods/Helpers.java, models/ActivateModel.java, models/GetKeyModel.java, models/DeactivateModel.java, and models/LicenseKey.java.
Preserve these invariants unless the task explicitly changes them:
Key.Activate(...)andKey.GetKey(...)force signed responses and returnnullon failure while populatingAPIError.LicenseKey.LoadFromString(...)verifies the RSA signature before returning a license object.LicenseKey.SaveAsString()/LicenseKey.LoadFromString(...)are the supported offline-license serialization path.Helpers.IsOnRightMachine(...)is only a meaningful validity gate when the license actually tracks machines. IfMaxNoOfMachines == 0, machine-binding is not active and the check should not be presented as a general validity test.- Keep the existing public API naming convention. Even though the Java style is unusual, methods such as
Key.Activate,Helpers.GetMachineCode, and fields such asLicenseServerUrlare public API and should not be renamed casually.
When writing sample code, wrappers, or integration snippets:
- Do not introduce new imports from
io.cryptolens.legacy.*. - Prefer
io.cryptolens.methods.*plusio.cryptolens.models.*. - Do not hardcode
3349or other sample product ids from docs. Make product id, token, RSA public key, and license key configurable or clearly labeled placeholders. - Prefer creating an
APIError error = new APIError();and surfacingerror.messagein examples that are intended for troubleshooting. - Mention cached signed-license fallback for production flows when the user asks for a robust verification design, but ask where the license string should be stored and how long offline use may stay valid before you bake that into code.
- Follow the timing guidance in official-workflows.md: verification normally happens on app start, when the user updates the license key, and sometimes periodically.
Machine code and platform-specific guidance
Open methods/Helpers.java, src/test/java/io/cryptolens/HelpersTest.java, and the current README/example app before changing platform guidance.
Use these rules:
- Treat
io.cryptolens.legacy.MachineCodeComputerand any otherio.cryptolens.legacy.*helper as obsolete for new code. Helpers.GetMachineCode()is the original default fingerprint path.Helpers.GetMachineCode(2)is the UUID-based Windows compatibility path used by existing docs and tests when callers want .NET/Python-aligned matching or fewer optional runtime dependencies.Helpers.GetMachineCode(3)is the newer multi-OS desktop path implemented in the current source. If you move examples or docs tov=3, update platform notes and tests in the same change instead of mixing recommendations.- For Android or other environments where local machine discovery is not appropriate, prefer the overloads that accept an explicit machine-code string:
Helpers.IsOnRightMachine(license, machineCode, ...). - For floating licenses, pass the correct
isFloatingLicense/allowOverdraftflags toIsOnRightMachine(...), and default overdraft to zero unless the user explicitly wants it.
Data objects, events, messages, products, and subscription usage
Use the method classes in src/main/java/io/cryptolens/methods/:
Data.javafor data objects on keys and machine codes.AI.javaforRegisterEvent.Message.javafor broadcast messages.ProductMethods.javaforGetProducts.Subscription.javafor metered usage recording.RequestModel.LicenseServerUrlon request models when routing through a self-hosted license server.
When editing docs or examples, preserve the model-based calling convention instead of rebuilding raw HTTP requests by hand.
For analytics and event-registration guidance, follow official-workflows.md:
- Prefer
AI.RegisterEvent. - Supply at least a meaningful
FeatureNameand eitherKeyorMachineCode. - Include
ProductIdwhen multiple products exist. - Use
ValueandCurrencyfor transaction-style events. - Do not assume the Java SDK has every helper shown in .NET docs; if metadata helpers are missing, populate metadata explicitly or explain the gap.
Examples, docs, and support fixes
Use official-workflows.md as the primary source for supported flows and product-level guidance, then use the repo README, example-app/src/Main.java, and the Java method/model classes to translate that guidance into current Java SDK usage.
The official docs currently cover:
- standard key verification
- offline verification with periodic refresh and air-gapped certificates
- trial keys
- username/password user verification as a product flow
- event registration and analytics data collection
- Java-specific installation, deactivation, floating licenses, and license-server routing
- adjacent Unity and Rhino/Grasshopper platform notes
Apply these rules when turning the docs into Java guidance:
- For offline verification, keep Java examples centered on
LicenseKey.SaveAsString()andLicenseKey.LoadFromString(...), and remember thatLoadFromString(...)does not validateProductId. - For manual activation files or certificates used by non-.NET consumers, follow the doc-backed "Other languages" format guidance in official-workflows.md.
- For trial keys, prefer
Key.CreateTrialKey(...)followed by normal activation, and keep the machine-binding check. - For user verification, do not invent Java SDK classes that are not present in the current repo. If the docs describe a product-level login flow without a matching Java wrapper, prefer Web API or backend guidance first, then activate the chosen license in Java if node-locking is needed.
- If the user asks about Unity or Rhino/Grasshopper, use the adjacent-platform notes in official-workflows.md for support context, but do not paste .NET-specific APIs into Java code.
Legacy migration and review work
If the task touches src/main/java/io/cryptolens/legacy:
- Assume the goal is compatibility or migration, not feature growth.
- Prefer moving callers toward
Key,Helpers, andmodels.LicenseKey. - Call out the type distinction clearly:
io.cryptolens.models.LicenseKeyis the supported model, whileio.cryptolens.legacy.LicenseKeyis compatibility-only. - If you update README examples, remove or avoid deprecated imports in the same pass.
Packaging and release-adjacent work
Use pom.xml as the source of truth for artifact metadata and dependencies.
Keep in mind:
- Artifact coordinates currently come from
io.cryptolens:cryptolens. gsonis a runtime dependency.oshi-coreis optional and only affects some machine-code helper paths.- Avoid dependency churn unless the task clearly needs it.
- Keep the README, example app, and Maven metadata aligned when public installation guidance changes.
Validation
If a local checkout is available, prefer the smallest proof that matches the change:
mvn -q -DskipTests compilefor API or packaging edits- focused test execution for pure helper/model behavior
- example-app compile or smoke updates for docs/example changes
Be careful with the existing test suite:
KeyTestand some other tests useapikeys.jsonand live API calls, so they are not safe as unconditional offline validation.HelpersTestis the best starting point for machine-code and feature-helper changes.- Avoid running live activation flows unless safe test credentials are already present and the task explicitly calls for end-to-end verification.
If no local checkout is available, limit the task to review, explanation, GitHub-based code changes, or documentation guidance unless a writable repository context is provided.
Resources
Read official-workflows.md for the official documentation-backed flows, caveats, and adjacent-platform notes.
Read repo-map.md for the file map and task routing.
Read java-workflows.md for Java-specific guidance, current method/class choices, and migration notes.