You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**eNot** (**Encoding Notations**) is a general purpose templating engine that serializes structured data into binary formats such as**ASN.1** and**BER-TLV**.
7
+
**eNot** (**Encoding Notations**) is a JSON-driven templating engine that serializes structured data into binary formats — primarily**ASN.1 DER**, with**BER-TLV** support showing the design is not limited to a single format.
8
8
9
-
A template describes the binary structure declaratively in JSON. At serialization time, placeholders are resolved from a parameter map, control structures (loops, conditions) are evaluated, and the result is encoded into the target binary format.
9
+
---
10
+
11
+
## The problem it solves
12
+
13
+
If you have ever written PKI tooling, you know the drill: encoding a Subject Distinguished Name, a Subject Alternative Name extension, or an X.509 Validity block means either reaching for a heavy framework that makes all the structural decisions for you, or writing low-level ASN.1 code that is brittle, hard to review, and even harder to reuse.
14
+
15
+
eNot takes a different approach. The binary structure is described as a plain JSON template:
16
+
17
+
```json
18
+
{
19
+
"type": "asn.1",
20
+
"attributes": { "tag": "utf8_string" },
21
+
"body": "${common_name}"
22
+
}
23
+
```
24
+
25
+
At serialization time you supply the values:
26
+
27
+
```java
28
+
Enot enot =newEnot(registry, objectMapper);
29
+
List<byte[]> der = enot.serialize(templateJson,
30
+
newSerializationContext.Builder(objectMapper)
31
+
.withParam("common_name", "Alice")
32
+
.build());
33
+
```
34
+
35
+
That's it. The engine resolves `${common_name}`, encodes the UTF-8 string as DER, and returns the bytes. No hard-coded structures, no framework lock-in.
36
+
37
+
---
38
+
39
+
## Going further — loops, conditions, and composition
40
+
41
+
Real certificate structures are not flat. eNot handles this with built-in control-flow elements.
42
+
43
+
**Loops** iterate over an array of parameters and produce one encoded element per entry — useful for multi-valued SANs or Organizational Unit lists:
**Conditions** encode a body only when an expression evaluates to `true` — for example, choosing between `UTCTime` and `GeneralizedTime` based on whether a date falls before or after 2050 (exactly as RFC 5280 requires):
**References** let one template include another by identifier at parse time, so large structures (like a full SAN extension) are assembled from smaller, independently testable pieces rather than one monolithic file.
79
+
80
+
---
81
+
82
+
## Why templates in JSON?
83
+
84
+
The format was a deliberate choice:
85
+
- Templates are **plain text** — version-controlled, diff-able, reviewable in a pull request
86
+
- The structure mirrors the binary output — a `sequence` wrapping a `set` wrapping a `utf8_string` is exactly how it looks in the JSON tree
87
+
- The engine is **format-agnostic** — the same parser and serializer infrastructure drives both the `asn.1` and `ber-tlv` type systems; new formats plug in via `EnotRegistry`
88
+
- Placeholder resolution, condition evaluation, and loop iteration are all **handled by the engine**, not scattered across application code
10
89
11
90
---
12
91
13
-
## Why eNot?
92
+
## Status
14
93
15
-
Most PKI and smart-card tooling either hard-codes binary structures or requires developers to work directly with low-level ASN.1 / BER-TLV APIs. eNot sits in between: templates are human-readable JSON files that can be version-controlled, reviewed, and reused, while the engine handles all binary encoding details.
94
+
> **eNot is not yet published to Maven Central.** Build locally first:
95
+
> ```
96
+
> mvn install
97
+
> ```
98
+
> Then reference the snapshot version (see [Quick Start](docs/quick-start.md)).
16
99
17
100
---
18
101
@@ -21,36 +104,33 @@ Most PKI and smart-card tooling either hard-codes binary structures or requires
21
104
| Module | Description |
22
105
|--------|-------------|
23
106
| `core` | Parser, serializer, expression engine, type registry |
24
-
|`ber-tlv`| BER-TLV extension (PoC — shows eNot is not ASN.1-only) |
25
-
|`web-tool`| Browser-based template editor and serializer (planned) |
107
+
| `ber-tlv` | BER-TLV type extension — proof that the engine is not tied to ASN.1 |
0 commit comments