· 8 years ago · Feb 13, 2018, 01:32 PM
1CREATE TABLE IF NOT EXISTS `user_as_key` (
2 `userserial` bigint(20) NOT NULL,
3 `is_active` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'if = 0 the user is created but doesn''t have the key yet',
4 `key_id` bigint(20) NOT NULL AUTO_INCREMENT,
5 `hash_pub_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
6 `public_key` varbinary(2048) DEFAULT NULL,
7 `pub_metadata_key` varbinary(2048) DEFAULT NULL COMMENT 'symmetric metadata_key encrypted with public key',
8 `pub_checksum_key` varbinary(2048) DEFAULT NULL COMMENT 'symmetric checksum_key encrypted with public key',
9 `revoked` tinyint(4) DEFAULT '0',
10 `is_primary` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'every user has two keys, primary and secondary',
11 PRIMARY KEY (`hash_pub_key`),
12 KEY `user_index` (`userserial`),
13 KEY `key_id` (`key_id`)
14) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;