diff options
author | Linus Nordberg <linus@nordu.net> | 2014-04-26 09:23:11 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2014-04-26 09:23:11 +0200 |
commit | d8857b08117ed441825725294032a14539f880b2 (patch) | |
tree | 3241e84c59f552d09d33a94ab81ac66de7b32b53 /src/plop.hrl | |
parent | 874050cb72f70206df81eecb3ac5435ff99d639d (diff) |
Clean up data types.
Diffstat (limited to 'src/plop.hrl')
-rw-r--r-- | src/plop.hrl | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/src/plop.hrl b/src/plop.hrl index e96b401..bfd900b 100644 --- a/src/plop.hrl +++ b/src/plop.hrl @@ -1,27 +1,21 @@ -% 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 = 0 :: integer(), % uint16 - entry = <<>> :: binary() - }). --type(plop_entry() :: #plop_entry{}). +%% A plop_entry has a type and some data. +%% A plop_data record has the meta data necessary for constructing a +%% signed timestamp. --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 = 0 :: integer(), % uint8 - timestamp = now :: 'now' | integer(), % 'now' or uint64 + version = 1 :: integer(), + signature_type = certificate_timestamp :: certificate_timestamp | + tree_hash | + test, + timestamp = now :: 'now' | integer(), entry :: plop_entry() + }). +-record(plop_entry, { + type = x509 :: x509 | precert | test, + data = <<>> :: binary() }). + -type plop_data() :: #plop_data{}. +-type plop_entry() :: #plop_entry{}. --export_type([plop_entry/0, plop_data/0]). +-export_type([plop_data/0, plop_entry/0]). |