本文整理匯總了Python中azurelinuxagent.common.utils.cryptutil.CryptUtil.gen_transport_cert方法的典型用法代碼示例。如果您正苦於以下問題:Python CryptUtil.gen_transport_cert方法的具體用法?Python CryptUtil.gen_transport_cert怎麽用?Python CryptUtil.gen_transport_cert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類azurelinuxagent.common.utils.cryptutil.CryptUtil
的用法示例。
在下文中一共展示了CryptUtil.gen_transport_cert方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: detect
# 需要導入模塊: from azurelinuxagent.common.utils.cryptutil import CryptUtil [as 別名]
# 或者: from azurelinuxagent.common.utils.cryptutil.CryptUtil import gen_transport_cert [as 別名]
def detect(self):
self.client.check_wire_protocol_version()
trans_prv_file = os.path.join(conf.get_lib_dir(),
TRANSPORT_PRV_FILE_NAME)
trans_cert_file = os.path.join(conf.get_lib_dir(),
TRANSPORT_CERT_FILE_NAME)
cryptutil = CryptUtil(conf.get_openssl_cmd())
cryptutil.gen_transport_cert(trans_prv_file, trans_cert_file)
self.client.update_goal_state(forced=True)
示例2: detect
# 需要導入模塊: from azurelinuxagent.common.utils.cryptutil import CryptUtil [as 別名]
# 或者: from azurelinuxagent.common.utils.cryptutil.CryptUtil import gen_transport_cert [as 別名]
def detect(self):
self.get_vminfo()
trans_prv_file = os.path.join(conf.get_lib_dir(),
TRANSPORT_PRV_FILE_NAME)
trans_cert_file = os.path.join(conf.get_lib_dir(),
TRANSPORT_CERT_FILE_NAME)
cryptutil = CryptUtil(conf.get_openssl_cmd())
cryptutil.gen_transport_cert(trans_prv_file, trans_cert_file)
#"Install" the cert and private key to /var/lib/waagent
thumbprint = cryptutil.get_thumbprint_from_crt(trans_cert_file)
prv_file = os.path.join(conf.get_lib_dir(),
"{0}.prv".format(thumbprint))
crt_file = os.path.join(conf.get_lib_dir(),
"{0}.crt".format(thumbprint))
shutil.copyfile(trans_prv_file, prv_file)
shutil.copyfile(trans_cert_file, crt_file)
示例3: mock_crypt_util
# 需要導入模塊: from azurelinuxagent.common.utils.cryptutil import CryptUtil [as 別名]
# 或者: from azurelinuxagent.common.utils.cryptutil.CryptUtil import gen_transport_cert [as 別名]
def mock_crypt_util(self, *args, **kw):
#Partially patch instance method of class CryptUtil
cryptutil = CryptUtil(*args, **kw)
cryptutil.gen_transport_cert = Mock(side_effect=self.mock_gen_trans_cert)
return cryptutil