java-json-canonicalization

Java JSON canonicalization JSON canonicalize implementation. Creates crypto safe predictable canocalization of JSON as defined by draft-rundgren-json-canonicalization-scheme

License

License

Categories

Categories

Java Languages JSON Data
GroupId

GroupId

io.github.erdtman
ArtifactId

ArtifactId

java-json-canonicalization
Last Version

Last Version

1.1
Release Date

Release Date

Type

Type

jar
Description

Description

java-json-canonicalization
Java JSON canonicalization JSON canonicalize implementation. Creates crypto safe predictable canocalization of JSON as defined by draft-rundgren-json-canonicalization-scheme
Project URL

Project URL

https://github.com/erdtman/java-json-canonicalization
Source Code Management

Source Code Management

https://github.com/erdtman/java-json-canonicalization

Download java-json-canonicalization

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.erdtman/java-json-canonicalization/ -->
<dependency>
    <groupId>io.github.erdtman</groupId>
    <artifactId>java-json-canonicalization</artifactId>
    <version>1.1</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.erdtman/java-json-canonicalization/
implementation 'io.github.erdtman:java-json-canonicalization:1.1'
// https://jarcasting.com/artifacts/io.github.erdtman/java-json-canonicalization/
implementation ("io.github.erdtman:java-json-canonicalization:1.1")
'io.github.erdtman:java-json-canonicalization:jar:1.1'
<dependency org="io.github.erdtman" name="java-json-canonicalization" rev="1.1">
  <artifact name="java-json-canonicalization" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.erdtman', module='java-json-canonicalization', version='1.1')
)
libraryDependencies += "io.github.erdtman" % "java-json-canonicalization" % "1.1"
[io.github.erdtman/java-json-canonicalization "1.1"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Build Status Coverage Status Maven Central

java-json-canonicalization

Java JSON canonicalization JSON canonicalize implementation. Creates crypto safe predictable canocalization of JSON as defined by RFC8785

Usage

Example JSON

Normal

{
  "from_account": "543 232 625-3",
  "to_account": "321 567 636-4",
  "amount": 500,
  "currency": "USD"
}

Crazy

{
  "1": {"f": {"f":  "hi","F":  5} ,"\n":  56.0},
  "10": { },
  "":  "empty",
  "a": { },
  "111": [ {"e":  "yes","E":  "no" } ],
  "A": { }
}

Java

String json = new String(Files.readAllBytes(Paths.get("filename.json")));
JsonCanonicalizer jc = new JsonCanonicalizer(json);
System.out.println(jc.getEncodedString());

// output normal: {"amount":500,"currency":"USD","from_account":"543 232 625-3","to_account":"321 567 636-4"}
// output crazy: {"":"empty","1":{"\n":56,"f":{"F":5,"f":"hi"}},"10":{},"111":[{"E":"no","e":"yes"}],"A":{},"a":{}}

Install

Apache Maven

<dependency>
  <groupId>io.github.erdtman</groupId>
  <artifactId>java-json-canonicalization</artifactId>
  <version>1.1</version>
</dependency>

Gradle Groovy DSL

compile 'io.github.erdtman:java-json-canonicalization:1.1'

Gradle Kotlin DSL

compile(group = "io.github.erdtman", name = "java-json-canonicalization", version = "1.1")

Scala SBT

libraryDependencies += "io.github.erdtman" % "java-json-canonicalization" % "1.1"

Apache Ivy

<dependency org="io.github.erdtman" name="java-json-canonicalization" rev="1.1" />

Groovy Grape

@Grapes(
  @Grab(group='io.github.erdtman', module='java-json-canonicalization', version='1.1')
)

Leiningen

[io.github.erdtman/java-json-canonicalization "1.1"]

Apache Buildr

'io.github.erdtman:java-json-canonicalization:jar:1.1'

PURL

pkg:maven/io.github.erdtman/[email protected]

Versions

Version
1.1
1.0