summaryrefslogtreecommitdiff
path: root/src/plop.hrl
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2014-04-25 12:21:38 +0200
committerLinus Nordberg <linus@nordu.net>2014-04-25 12:21:38 +0200
commit80ae7bd6d3e139078ee58d9861f159b555d28b38 (patch)
tree96646e9643bc23944b3aee855becd73b4b3f4256 /src/plop.hrl
parentfad037a338a48a4e83b33860663632a774aff522 (diff)
Produce SPT's, add tests.
NOTE: Test vectors not verified.
Diffstat (limited to 'src/plop.hrl')
-rw-r--r--src/plop.hrl27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/plop.hrl b/src/plop.hrl
new file mode 100644
index 0000000..a4f2bb6
--- /dev/null
+++ b/src/plop.hrl
@@ -0,0 +1,27 @@
+% TODO: move to plop.hrl?
+%% -record(spt, {
+%% version :: integer(), % 8_bit_int
+%% logid :: binary(), % 32_bit_binary() sha256 hash
+%% signed_data :: signed_data()
+%% }).
+-define(PLOP_ENTRY_TYPE_X509, 0).
+-define(PLOP_ENTRY_TYPE_PRECERT, 1).
+-define(PLOP_ENTRY_TYPE_TEST, 2).
+-record(plop_entry, {
+ type :: integer(), % uint16
+ entry :: binary()
+ }).
+-type(plop_entry() :: #plop_entry{}).
+
+-define(PLOP_SIGTYPE_CERTIFICATE_TIMESTAMP, 0).
+-define(PLOP_SIGTYPE_TREE_HASH, 1).
+-define(PLOP_SIGTYPE_TEST, 2).
+-record(plop_data, {
+ version = 1 :: integer(), % uint8
+ signature_type :: integer(), % uint8
+ timestamp = now :: 'now' | binary(), % atom or uint64
+ entry :: plop_entry()
+ }).
+-type plop_data() :: #plop_data{}.
+
+-export_type([plop_entry/0, plop_data/0]).