Download the PHP package getkeymanager/php-sdk without Composer
On this page you can find all versions of the php package getkeymanager/php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download getkeymanager/php-sdk
More information about getkeymanager/php-sdk
Files in getkeymanager/php-sdk
Package php-sdk
Short Description Official PHP SDK for License Management Platform API
License MIT
Homepage https://getkeymanager.com
Informations about the package php-sdk
KeyManager - PHP SDK
Version: 3.0.0 - Identifier-first architecture with offline-first validation!
Features
Core Features (v1.x)
- ✅ License validation (online and offline)
- ✅ License activation and deactivation
- ✅ Feature flag checking
- ✅ Hardware ID generation
- ✅ Telemetry submission
- ✅ RSA-4096-SHA256 signature verification
- ✅ Automatic retry with exponential backoff
- ✅ Built-in caching
- ✅ Idempotent operations
- ✅ PSR-12 compliant
New in v2.0.0
- ✅ Complete license management - Create, update, delete, list licenses
- ✅ License assignment - Assign licenses to customers (sync & async)
- ✅ Metadata management - Custom metadata for licenses and products
- ✅ Product management - Create and manage products via API
- ✅ Generator support - Generate licenses programmatically
- ✅ Contract management - Manage API contracts
- ✅ Downloadables access - Provide downloadable files to users
- ✅ Advanced telemetry - Retrieve telemetry data with filters
- ✅ Public changelog API - Access changelogs without authentication
New in v2.1.0
- ✅ New endpoints:
getLicenseFile(),getProductMeta(),getProduct(),getProductChangelog(),getProductPublicKey() - ✅ New response codes: LICENSE_FILE_RETRIEVED (502), LICENSE_FILE_GENERATION_FAILED (503), LICENSE_KEY_NOT_FOUND_DETAILS (501), PRODUCT_FOUND (631), PRODUCT_PUBLIC_KEY_FOUND (632), PRODUCT_PUBLIC_KEY_NOT_FOUND (633)
- ✅ Offline .lic parsing:
parseLicenseFile()(Base64 decode → 256-byte chunks → RSA PKCS1 decrypt → JSON) - ✅ License/key sync:
syncLicenseAndKey()with atomic file updates + telemetry - ✅ Validation timers:
isCheckIntervalPast()andisForceValidationPast()(fail-safe true on error)
New in v3.0.0 - BREAKING CHANGES
- ✅ Mandatory Identifier Parameter - All validation/activation methods now require
$identifier(domain or HWID) - ✅ Configuration Inheritance - Set
productPublicKey,licenseKey,licenseFilePath,defaultIdentifieronce, reuse everywhere - ✅ Offline-First Validation - Try cached .lic file first, fallback to API with
ValidationTypeconstants - ✅ Type-Safe DTOs -
ValidationResultDto,ActivationResultDto,SyncResultDtowith typed accessors - ✅ Constants & Enums -
ValidationType,IdentifierType,OptionKeysfor predictable behavior - ✅ Helper Methods -
generateIdentifier(),getIdentifierOrGenerate(),resolvePublicKey(),canValidateOffline() - ✅ Enhanced Error Messages - Actionable, context-aware errors with documentation links
- ⚠️ ⚠️ MIGRATION REQUIRED: See Migration Guide v2→v3 below
Offline .lic Parsing (LicenseValidator)
Force Validation Check
30+ new methods added while maintaining full backward compatibility!
Requirements
- PHP 7.4 or higher
- ext-json
- ext-openssl
- ext-curl
Installation
Via Composer (Recommended)
Manual Installation
- Download the SDK files
- Include the autoloader:
Quick Start
Initialize the Client
Validate a License (Online)
Activate a License
Deactivate a License
Check Feature Flags
Validate Offline License
Send Telemetry
Generate Hardware ID
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
apiKey |
string | required | Your API key |
publicKey |
string | null | RSA public key for signature verification |
baseUrl |
string | https://api.getkeymanager.com |
API base URL |
timeout |
int | 30 | Request timeout in seconds |
verifySignatures |
bool | true | Verify response signatures |
environment |
string | null | Environment (production/staging/development) |
cacheEnabled |
bool | true | Enable response caching |
cacheTtl |
int | 300 | Cache TTL in seconds |
retryAttempts |
int | 3 | Number of retry attempts |
retryDelay |
int | 1000 | Retry delay in milliseconds |
Error Handling
The SDK uses a hierarchy of exceptions:
Example Error Handling
Caching
The SDK automatically caches:
- License validation responses
- Feature flag checks
Clear Cache
Signature Verification
All API responses are cryptographically signed. The SDK automatically verifies signatures when verifySignatures is enabled.
Using SignatureVerifier Directly
Verify JSON Response
Idempotency
Activation and deactivation operations support idempotency:
Best Practices
1. Store API Key Securely
2. Cache Hardware ID
3. Handle Network Failures Gracefully
4. Validate Licenses Periodically
Testing
Examples
See the /examples directory for complete working examples:
validate.php- Basic license validationactivate.php- License activationfeatures.php- Feature flag checkingoffline.php- Offline license validationtelemetry.php- Sending telemetry data
Support
- Website: https://getkeymanager.com
- Documentation: https://docs.getkeymanager.com
- API Reference: https://dev.getkeymanager.com/api
- Issues: https://github.com/getkeymanager/php-sdk/issues
- Email: [email protected]
License
MIT License - see LICENSE file for details
Contributing
Contributions are welcome! Please read CONTRIBUTING.md for guidelines.
Changelog
See CHANGELOG.md for version history.
All versions of php-sdk with dependencies
ext-json Version *
ext-openssl Version *
ext-curl Version *