Awesome
Iridium CBOR-LD
An implementation of the CBOR-LD 1.0 in Java.
Features
- Semantic compression / decompression
- Configurable API
- Custom document dictionaries and builders
- Verifiable Credential Barcodes
Status
CLI
LD-CLI is a command line utility for Ubuntu, Mac and Windows.
Usage
Encoding
// create an encoder builder initialized with default values
var encoder = CborLd.createEncoder()
// use bundled static contexts (true by default)
.useBundledContexts(true)
// loader (optional)
.loader(...)
// custom terms dictionary (optional)
.dictionary(customDictionary)
// create a new encoder instance
.build();
// create barcodes encoder builder
var encoder = CborLd.createEncoder(BarcodesConfig.INSTANCE)
// ... customize
.build()
// encode a document
byte[] encoded = encoder.encode(document);
Decoding
// create a decoder builder initialized with default values
var decoder = CborLd.createDecoder()
// use bundled static contexts (true by default)
.useBundledContexts(true)
// loader (optional)
.loader(...)
// add custom terms dictionary (optional)
.dictionary(customDictionary);
// create a new decoder instance
.build();
// create barcodes decoder builder
var decoder = CborLd.createDecoder(BarcodesConfig.INSTANCE)
// ... customize
.build()
// decode
document = decoder.decode(encoded);
Backward Compatibility
// Iridium < v0.2.0
CborLd.create[Encoder|Decoder](V05Config.INSTANCE)
// ... customize
.build();
// Iridium < v0.2.0, @digitalbazaar/cborld compatibility
CborLd.create[Encoder|Decoder](V05Config.INSTANCE)
.compactArrays(false)
// ... customize
.build();
Installation
Java 17+
<dependency>
<groupId>com.apicatalog</groupId>
<artifactId>iridium-cbor-ld</artifactId>
<version>0.3.0</version>
</dependency>
Iridium CBOR-LD for Android is distributed under a commercial license. Contact
JSON-P Provider
Add JSON-P provider, if it is not on the classpath already.
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.json</artifactId>
<version>2.0.1</version>
</dependency>
Documentation
Contributing
All PR's welcome!
Building
Fork and clone the project repository.
> cd iridium-cbor-ld
> mvn clean package
Resources
- CBOR-LD 1.0
- Concise Binary Object Representation (CBOR)
- Hello CBOR-LD Presentation
- cbor.io
- JavaScript CBOR-LD Processor
- CBOR Playground
Sponsors
<a href="https://github.com/digitalbazaar"> <img src="https://avatars.githubusercontent.com/u/167436?s=200&v=4" width="40" /> </a>Commercial Support
Commercial support is available at filip26@gmail.com