def _get_certivox_server_secret_share(self, expires):
method = options.certivoxServerSecret
methods = {
'dta': self._get_certivox_server_secret_share_dta,
'credentials.json': self._get_certivox_server_secret_share_credentials,
'manual': lambda x: raw_input('MIRACL server secret share:'),
'config': lambda x: options.certivoxServerSecret
}
func = methods[method if method in methods else 'config']
certivox_server_secret_hex = func(expires)
try:
return certivox_server_secret_hex.decode("hex")
except TypeError as e:
log.error(e)
raise SecretsError('Invalid CertiVox server secret share')
评论列表
文章目录