proget-hq / knox-token
Support library for signing Samsung Knox API access tokens
Installs: 914 493
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 3
Forks: 8
Open Issues: 2
Requires
- php: >=7.4
- ext-json: *
- firebase/php-jwt: ^6.3
- ramsey/uuid: ^3.8 || ^4.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.11
- phpstan/phpstan: ^1.8.6
- phpstan/phpstan-phpunit: ^1.1
- phpunit/phpunit: ^9.3
This package is auto-updated.
Last update: 2024-11-06 19:51:30 UTC
README
Support library for signing Samsung Knox API access tokens
Install
composer require proget-hq/knox-token
Usage
More info at Knox Cloud API Integration Guide
Sign your Client Identifier
use Proget\Samsung\KnoxToken\Certificate; use Proget\Samsung\KnoxToken\KnoxToken; $clientIdentifierJwt = KnoxToken::signClientIdentifier('your-client-identifier', Certificate::fromPath('keys.json'));
Sign your Access Token
use Proget\Samsung\KnoxToken\Certificate; use Proget\Samsung\KnoxToken\KnoxToken; $accessTokenJwt = KnoxToken::signAccessToken('access-token', Certificate::fromPath('keys.json'));
Load certificate
use Proget\Samsung\KnoxToken\Certificate; $certificate = Certificate::fromPath('keys.json'); $certificate->publicKey(); $certificate->privateKeyPem();
License
MIT