-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 33ea940
Showing
43 changed files
with
9,867 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Publish to GitHub Pages | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
- run: npm ci | ||
- run: npm run build --workspace examples | ||
- uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: examples/dist | ||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
permissions: | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/node_modules | ||
/dist | ||
/cjs | ||
/esm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extension": ["ts"], | ||
"spec": "src/**/*.spec.ts", | ||
"require": "ts-node/register", | ||
"loader": "ts-node/esm", | ||
"recursive": true, | ||
"watch-files": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/examples | ||
/docs | ||
/dist | ||
/src/**/*.spec.ts | ||
/.* | ||
/*.code-workspace | ||
/tsconfig* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"quoteProps": "consistent", | ||
"singleQuote": true, | ||
"semi": false, | ||
"printWidth": 120 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": "always" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# NotCCID | ||
|
||
The NotCCID communication protocol is only available for [ESTKme-RED] product. | ||
|
||
[ESTKme-RED]: https://www.estk.me/product/estkme-red/ | ||
|
||
## Installation | ||
|
||
```bash | ||
# Install from GitHub Packages (Unstable) | ||
npm install @estkme-group/notccid --registry=https://npm.pkg.github.com | ||
``` | ||
|
||
## References | ||
|
||
- [Running the example locally](docs/examples.md) | ||
- [Protocol Design](docs/protocol-design.md) | ||
- [Debugging in Chrome](docs/chrome-debugger.md) | ||
- [WebBLEBackend.ts](src/backends/WebBLEBackend.ts) | ||
- [WebUSBBackend.ts](src/backends/WebUSBBackend.ts) | ||
|
||
## LICENSE | ||
|
||
[AGPLv3 only](LICENSE.txt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Debugging in Google Chrome | ||
|
||
## WebUSB | ||
|
||
Internal: `chrome://usb-internals` | ||
|
||
Logging: `chrome://device-log/?refresh=1&types=USB` | ||
|
||
## Web Bluetooth | ||
|
||
Internal: `chrome://bluetooth-internals` | ||
|
||
Logging: `chrome://device-log/?refresh=1&types=Bluetooth` | ||
|
||
## References | ||
|
||
- [Access USB Devices on the Web](https://developer.chrome.com/docs/capabilities/usb) | ||
- [Communicating with Bluetooth devices over JavaScript](https://developer.chrome.com/docs/capabilities/bluetooth) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# NotCCID Examples | ||
|
||
## Quick start | ||
|
||
```console | ||
$ # install dependencies | ||
$ npm ci | ||
... | ||
$ # run the examples | ||
$ npm run examples | ||
|
||
> @estkme-group/notccid@0.0.0 examples | ||
> npm start --workspace examples | ||
|
||
|
||
> @estkme-group/notccid-examples@0.0.0 start | ||
> webpack serve --mode development | ||
|
||
<i> [webpack-dev-server] Generating SSL certificate... | ||
<i> [webpack-dev-server] SSL certificate: ******** | ||
<i> [webpack-dev-server] Project is running at: | ||
<i> [webpack-dev-server] Loopback: https://localhost:8080/, https://[::1]:8080/ | ||
<i> [webpack-dev-server] On Your Network (IPv4): ******** | ||
<i> [webpack-dev-server] Content not from webpack is served from '*' directory | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# NotCCID Protocol Design | ||
|
||
The NotCCID communication protocol is only available for [ESTKme-RED] product. | ||
|
||
[ESTKme-RED]: https://www.estk.me/product/estkme-red/ | ||
|
||
## Protocol format | ||
|
||
### Packet Format | ||
|
||
| Offset | Field | Type | | ||
| ------ | -------------------- | -------------------- | | ||
| 0 | [Type](#packet-type) | 1 byte | | ||
| 1 | Length | 2 bytes (Uint16, LE) | | ||
| 3…n | Payload | n bytes | | ||
|
||
### Packet Type | ||
|
||
| Type | Payload | Inserted | Claimed | Description | | ||
| ---- | ----------- | :------: | :-----: | ---------------------- | | ||
| `00` | \<empty> | N | N | Get Status | | ||
| `01` | `RRGGBB` | N | N | Emit RGB LED | | ||
| `01` | \<empty> | N | N | Reset RGB LED | | ||
| `02` | `b'ESTKme'` | Y | N | Claim | | ||
| `02` | \<empty> | Y | Y | Release | | ||
| `03` | `0100` | Y | Y | Power On Card, No PPS | | ||
| `03` | `0101` | Y | Y | Power On Card, Use PPS | | ||
| `03` | \<empty> | Y | Y | Power Off Card | | ||
| `04` | \<APDU> | Y | Y | Transmit APDU | | ||
| `F0` | \<empty> | Y | N | eSTK.me Recovery Mode | | ||
|
||
## Main Workflow | ||
|
||
```mermaid | ||
flowchart | ||
claim["Claim"] | ||
release["Release"] | ||
transmit["Transmit APDU"] | ||
powerOn["Power On"] | ||
powerOff["Power Off"] | ||
claim -- claimed --> powerOn | ||
claim -- released --> release | ||
powerOff -- released --> release | ||
powerOn --> transmit | ||
transmit --> powerOff | ||
powerOff --> powerOn | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# ESTKme-RED Diagram | ||
|
||
## Uncontrolled RGB LED State Diagram | ||
|
||
### General | ||
|
||
```mermaid | ||
stateDiagram-v2 | ||
classDef white fill:white,color:#000 | ||
classDef blue fill:blue,color:#fff | ||
classDef green fill:green,color:#000 | ||
classDef red fill:red,color:#000 | ||
classDef yellow fill:yellow,color:#000 | ||
[*] --> White:::white: Booting | ||
White --> Red:::red: No response | ||
White --> Green:::green: Using USB | ||
White --> Yellow:::yellow: BLE Initializing | ||
Yellow --> Blue:::blue: Using BLE | ||
``` | ||
|
||
### DFU Mode | ||
|
||
Short C1 and C3 pins to enter ESTKme-RED reader DFU mode | ||
|
||
see [Smartcard Pinout](https://en.wikipedia.org/wiki/Smart_card#/media/File:SmartCardPinout.svg) definiton | ||
|
||
```mermaid | ||
stateDiagram-v2 | ||
classDef blue fill:blue,color:#fff | ||
classDef green fill:green,color:#000 | ||
classDef red fill:red,color:#000 | ||
[*] --> Blue:::blue: Enter DFU mode | ||
Blue --> Green:::green | ||
Green --> Red:::red | ||
Red --> Off: Erase firmware | ||
Off --> [*]: Entered DFU mode | ||
Blue --> Boot | ||
Green --> Boot | ||
Red --> Boot | ||
Boot --> [*]: Booting App | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"folders": [ | ||
{ "name": "NotCCID", "path": "." }, | ||
{ "name": "NotCCID (Examples)", "path": "examples" } | ||
], | ||
"settings": { | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": "always" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/node_modules | ||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"quoteProps": "consistent", | ||
"singleQuote": true, | ||
"jsxSingleQuote": true, | ||
"semi": false, | ||
"printWidth": 120 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "@estkme-group/notccid-examples", | ||
"version": "0.0.0", | ||
"private": true, | ||
"scripts": { | ||
"start": "webpack serve --mode development", | ||
"build": "webpack build --mode production" | ||
}, | ||
"dependencies": { | ||
"async-mutex": "^0.5.0", | ||
"bootstrap": "^5.3.3", | ||
"domready": "^1.0.8", | ||
"react": "^18.3.1", | ||
"react-bootstrap": "^2.10.5", | ||
"react-dom": "^18.3.1" | ||
}, | ||
"devDependencies": { | ||
"@types/domready": "~1.0.2", | ||
"@types/react": "~18.3.11", | ||
"@types/react-color": "^3.0.12", | ||
"@types/react-dom": "~18.3.0", | ||
"css-loader": "^7.1.2", | ||
"html-webpack-plugin": "^5.6.0", | ||
"mini-css-extract-plugin": "^2.9.1", | ||
"ts-loader": "^9.5.1", | ||
"ts-node": "^10.9.2", | ||
"tsconfig-paths-webpack-plugin": "^4.1.0", | ||
"typescript": "^5.6.3", | ||
"webpack": "^5.95.0", | ||
"webpack-cli": "^5.1.4", | ||
"webpack-dev-server": "^5.1.0" | ||
} | ||
} |
Oops, something went wrong.