Hello Matthias-Christian,
On 17.2.2015 01:19, Matthias-Christian Ott wrote:
Is there any reason why you chose JSON over a simple
and securely and
deterministically parseable file format for KASP?
We were looking for something, which is easy parseable by machines,
readable by humans, and available in popular scripting languages.
We originally wanted to use YAML (because the syntax is more
user-friendly), but we weren't satisfied with current open-source
implementations of YAML libraries. JSON was the second candidate. And
libjansson provides really nice and convenient API.
I'm aware that we won't please everyone by this decision. But I,
personally, prefer well-known and widespread format than a custom one.
I agree that JSON is not very simple, but it is definitelly secure and
deterministically parsable:
# Python
import json
with open("policy_default.json") as f:
data = json.load(f)
print("RRSIG lifetime: %d" % data["rrsig_lifetime"])
# Ruby
require 'json'
data = File.open("policy_default.json") do |f|
JSON.load(f)
end
puts "RRSIG lifetime: %d" % data["rrsig_lifetime"]
# Bash
(I give up... it won't be simple. But I can parse output of keymgr...)
If you have any strong opinions against JSON, we can still discuss it.
But as for me, I think using JSON is fine for this purpose.
Best regards,
Jan