Add methods for storing and retrieving the raw key json

This commit is contained in:
Mark Haines 2015-04-15 16:58:35 +01:00
parent 8d761134c2
commit a429515bdd
2 changed files with 59 additions and 3 deletions

View file

@ -13,12 +13,12 @@
* limitations under the License.
*/
CREATE TABLE IF NOT EXISTS server_keys (
CREATE TABLE IF NOT EXISTS server_keys_json (
server_name TEXT, -- Server name.
key_id TEXT, -- Requested key id.
from_server TEXT, -- Which server the keys were fetched from.
ts_added_ms INTEGER, -- When the keys were fetched
ts_expires_ms INTEGER, -- When this version of the keys exipires.
ts_valid_until_ms INTEGER, -- When this version of the keys exipires.
key_json BLOB, -- JSON certificate for the remote server.
CONSTRAINT uniqueness UNIQUE (server_name, key_id)
CONSTRAINT uniqueness UNIQUE (server_name, key_id, from_server)
);