本文整理汇总了Python中cybox.objects.uri_object.URI.from_obj方法的典型用法代码示例。如果您正苦于以下问题:Python URI.from_obj方法的具体用法?Python URI.from_obj怎么用?Python URI.from_obj使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cybox.objects.uri_object.URI
的用法示例。
在下文中一共展示了URI.from_obj方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: from_obj
# 需要导入模块: from cybox.objects.uri_object import URI [as 别名]
# 或者: from cybox.objects.uri_object.URI import from_obj [as 别名]
def from_obj(registrar_obj):
if not registrar_obj:
return None
registrar = WhoisRegistrar()
registrar.registrar_id = String.from_obj(registrar_obj.get_Registrar_ID())
registrar.registrar_guid = String.from_obj(registrar_obj.get_Registrar_GUID())
registrar.name = String.from_obj(registrar_obj.get_Name())
registrar.address = String.from_obj(registrar_obj.get_Address())
registrar.email_address = Address.from_obj(registrar_obj.get_Email_Address())
registrar.phone_number = String.from_obj(registrar_obj.get_Phone_Number())
registrar.whois_server = URI.from_obj(registrar_obj.get_Whois_Server())
registrar.referral_url = URI.from_obj(registrar_obj.get_Referral_URL())
registrar.contacts = WhoisContacts.from_obj(registrar_obj.get_Contacts())
return registrar
示例2: from_obj
# 需要导入模块: from cybox.objects.uri_object import URI [as 别名]
# 或者: from cybox.objects.uri_object.URI import from_obj [as 别名]
def from_obj(mal_conf_storage_obj):
if not mal_conf_storage_obj:
return None
mal_conf_storage_ = MalwareConfigurationStorageDetails()
mal_conf_storage_.malware_binary = MalwareBinaryConfigurationStorageDetails.from_obj(mal_conf_storage_obj.get_Malware_Binary())
mal_conf_storage_.file = File.from_obj(mal_conf_storage_obj.get_File())
if mal_conf_storage_obj.get_URL():
mal_conf_storage_.url = [URI.from_obj(x) for x in mal_conf_obj.get_URL()]
return mal_conf_storage_
示例3: from_obj
# 需要导入模块: from cybox.objects.uri_object import URI [as 别名]
# 或者: from cybox.objects.uri_object.URI import from_obj [as 别名]
def from_obj(dns_record_obj):
if not dns_record_obj:
return None
dns_record_ = DNSRecord()
dns_record_.description = StructuredText.from_obj(dns_record_obj.get_Description())
dns_record_.domain_name = URI.from_obj(dns_record_obj.get_Domain_Name())
dns_record_.ip_address = Address.from_obj(dns_record_obj.get_IP_Address())
dns_record_.address_class = String.from_obj(dns_record_obj.get_Address_Class())
dns_record_.entry_type = String.from_obj(dns_record_obj.get_Entry_Type())
dns_record_.record_name = String.from_obj(dns_record_obj.get_Record_Name())
dns_record_.record_type = String.from_obj(dns_record_obj.get_Record_Type())
dns_record_.ttl = Integer.from_obj(dns_record_obj.get_TTL())
dns_record_.flags = HexBinary.from_obj(dns_record_obj.get_Flags())
dns_record_.data_length = Integer.from_obj(dns_record_obj.get_Length())
dns_record_.record_data = dns_record_obj.get_Record_Data()
return dns_record_
示例4: from_obj
# 需要导入模块: from cybox.objects.uri_object import URI [as 别名]
# 或者: from cybox.objects.uri_object.URI import from_obj [as 别名]
def from_obj(message_obj):
message = EmailMessage()
attachments = message_obj.get_Attachments()
if attachments:
for attachment in attachments.get_File():
message.attachments.append(File.from_obj(attachment))
links = message_obj.get_Links()
if links:
for link in links.get_Link():
message.links.append(URI.from_obj(link))
message.header = EmailHeader.from_obj(message_obj.get_Header())
message.optional_header = OptionalHeader.from_obj(message_obj.get_Optional_Header())
message.email_server = String.from_obj(message_obj.get_Email_Server())
message.raw_body = String.from_obj(message_obj.get_Raw_Body())
message.raw_header = String.from_obj(message_obj.get_Raw_Header())
return message