How is the «vault_payment_token» database table implemented and used?

The structure

CREATE TABLE `vault_payment_token` (
  `entity_id` int(10) UNSIGNED NOT NULL COMMENT 'Entity Id',
  `customer_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'Customer Id',
  `public_hash` varchar(128) NOT NULL COMMENT 'Hash code for using on frontend',
  `payment_method_code` varchar(128) NOT NULL COMMENT 'Payment method code',
  `type` varchar(128) NOT NULL COMMENT 'Type',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `expires_at` timestamp NULL DEFAULT NULL COMMENT 'Expires At',
  `gateway_token` varchar(255) NOT NULL COMMENT 'Gateway Token',
  `details` text COMMENT 'Details',
  `is_active` tinyint(1) NOT NULL COMMENT 'Is active flag',
  `is_visible` tinyint(1) NOT NULL COMMENT 'Is visible flag'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Vault tokens of payment';

A sample row

entity_id 1
customer_id 1
public_hash beb166f1a00a8cf7c3088fccba1e5fc857acb6b842a582e3b94a0f70f5f5b354
payment_method_code braintree
type card
created_at 2017-06-06 01:35:35
expires_at 2017-08-01 03:00:00
gateway_token kpvhv8
details {"type":"MC","maskedCC":"4444","expirationDate":"07\/2017"}
is_active 1
is_visible 1


It is used through the Magento\Vault\Model\ResourceModel\PaymentToken resource model.

See also: