Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shizhmsft/cq
Command-line CBOR processor
https://github.com/shizhmsft/cq
cbor cose go
Last synced: about 1 month ago
JSON representation
Command-line CBOR processor
- Host: GitHub
- URL: https://github.com/shizhmsft/cq
- Owner: shizhMSFT
- License: apache-2.0
- Created: 2022-04-11T03:14:09.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-07T05:39:03.000Z (about 1 month ago)
- Last Synced: 2024-12-07T06:26:33.350Z (about 1 month ago)
- Topics: cbor, cose, go
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cq - Command-line CBOR processor
> [!IMPORTANT]
> This tool is for demonstration purpose. DO NOT use in production.
>
> For production use, the following libraries are recommended:
> - CBOR: [github.com/fxamacker/cbor](https://github.com/fxamacker/cbor)
> - COSE: [github.com/veraison/go-cose](https://github.com/veraison/go-cose)`cq` is a simple command-line CBOR parser developed from scratch.
## Build and Install
> **Note**
> Make sure `go 1.23.1` or above is installed before `make`.To build and install `cq` to `~/bin` on Linux, simply run
```bash
make install
```## Examples
### Usage
Get the usage of `cq`.
```console
$ cq
NAME:
cq - Command-line CBOR processorUSAGE:
cq [options] [file]VERSION:
v0.2.0GLOBAL OPTIONS:
--cose-payload decode the payload of a COSE message (default: false)
--help, -h show help
--version, -v print the version
```### Print a CBOR Object
Inspect a CBOR object in a file.
```shell
cq file.cbor
```Alternatively, `stdin` is also accepted.
```bash
cq < file.cbor
cat file.cbor | cq
```### Extract the Payload of a COSE Signature
Extract the payload of a `COSE_Sign1` object.
```shell
cq --cose-payload cose.sig
```