Accept the provided key

def accept(self, pub):
        '''
        Accept the provided key
        '''
        try:
            with salt.utils.files.fopen(self.path, 'r') as fp_:
                expiry = int(fp_.read())
        except (OSError, IOError):
            log.error(
                'Request to sign key for minion \'%s\' on hyper \'%s\' '
                'denied: no authorization', self.id, self.hyper
            )
            return False
        except ValueError:
            log.error('Invalid expiry data in %s', self.path)
            return False

        # Limit acceptance window to 10 minutes
        # TODO: Move this value to the master config file
        if (time.time() - expiry) > 600:
            log.warning(
                'Request to sign key for minion "%s" on hyper "%s" denied: '
                'authorization expired', self.id, self.hyper
            )
            return False

        pubfn = os.path.join(self.opts['pki_dir'],
                'minions',
                self.id)
        with salt.utils.files.fopen(pubfn, 'w+') as fp_:
            fp_.write(pub)
        self.void()
        return True