KnoxTokenLibrary-Python ('PyKTL')
This is not an offical Samsung library or repository
pyktl is a python rewrite of the knox-token-library-js library written by Samsung. The following code was used to build this project. https://www.npmjs.com/package/knox-token-library-js?activeTab=readme
Usage
Install using:
pip install PyKTL
Assumptions
- You have downloaded the Knox Certificate file (certificate.json)
- You have generated a Client Identifier (api-key) for accessing apis of Knox Cloud Services.
Intended Use
The workflow for making api calls to Knox Cloud Services is divided into a portal workflow, and a programmatic workflow.
Portal flow
- Download Certificate from Knox Api Portal
- Generate and Download ClientIdentifier (api-key) for a specific Knox Solution
Programmatic flow
-
Call Knox api to generate an Api Access Token. This api call requires a signed ClientIdentifier, and specific contents of your Certificate (Public Key).
-
Call Knox api for your intended workflow (eg: upload device, configure device etc). This api call requires your signed Api Access Token, and specific contents of your Certificate (Public Key).
-
This utility py library helps generate signed clientIdentifiers, and signed accessTokens.
Examples
Leverage examples from here.
The example leverages a keys.json which is obtained using the SamsungKnox.com portal - view the Samsung tutorial for more details. The example also leverages clientId.json which includes the clientIds
{
"kme": "",
"kc": "",
"ke1": "",
"kai": ""
}
You can also reference Samsung's authentication tutorail found here: https://docs.samsungknox.com/dev/knox-cloud-authentication/tutorial/tutorial-for-customers-generate-access-token/. I did attempt to keep only required method names, so not all methods found in the nodejs/java/NuGet package will be available in PyKTL.
Local Build & Install
In order to build and install pyktl locally you can run the following commands:
python setup.py sdist
pip install .
KDP API Support
While no testing was done using the PyKTL and the Knox Deployment Program API - it is believed it should still work. Authentication between the KCS APIs and KCS APIs appears to be the same.
Metadata
Release files for PyKTL 0.3.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| PyKTL-0.3.8.tar.gz | 4.4 kB | Without provenance | Details for PyKTL-0.3.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| PyKTL-0.3.8-py3-none-any.whl | Python 3 | none | any | Details for PyKTL-0.3.8-py3-none-any.whl |
Total release size: 9.1 kB
Release files / PyKTL-0.3.8.tar.gz
| Download URL | PyKTL-0.3.8.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ab08c7a38bd56583f6ef923a2eb9ea5d19c326f48d5c8d8b7635c13616308eb
|
|
BLAKE2b-256 checksum How to use checksums |
c2ab778aad2c3d82afea5538d0b7a6c727a316d64224999cd29cc0205854765d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / PyKTL-0.3.8-py3-none-any.whl
| Download URL | PyKTL-0.3.8-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dd3e68d6d8c3862aba0b4dd880fd1a3e8e43c7242e32772b5da84841fa1a63dd
|
|
BLAKE2b-256 checksum How to use checksums |
c8c83e0ebf395ad1e1b41d34c7dd93be80f44d3de0273e1544cf2007f0bceb78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Security for PyKTL 0.3.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.