本文整理汇总了Python中cryptography.x509.oid.NameOID.EMAIL_ADDRESS属性的典型用法代码示例。如果您正苦于以下问题:Python NameOID.EMAIL_ADDRESS属性的具体用法?Python NameOID.EMAIL_ADDRESS怎么用?Python NameOID.EMAIL_ADDRESS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类cryptography.x509.oid.NameOID
的用法示例。
在下文中一共展示了NameOID.EMAIL_ADDRESS属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: subject_name
# 需要导入模块: from cryptography.x509.oid import NameOID [as 别名]
# 或者: from cryptography.x509.oid.NameOID import EMAIL_ADDRESS [as 别名]
def subject_name(self):
attribute_list = []
if self.common_name:
attribute_list.append(
x509.NameAttribute(
NameOID.COMMON_NAME, text_type(self.common_name)
)
)
if self.organization:
attribute_list.append(
x509.NameAttribute(
NameOID.ORGANIZATION_NAME, text_type(self.organization)
)
)
if self.organizational_unit:
attribute_list.append(
x509.NameAttribute(
NameOID.ORGANIZATIONAL_UNIT_NAME,
text_type(self.organizational_unit),
)
)
if self.country:
attribute_list.append(
x509.NameAttribute(
NameOID.COUNTRY_NAME, text_type(self.country)
)
)
if self.state:
attribute_list.append(
x509.NameAttribute(
NameOID.STATE_OR_PROVINCE_NAME, text_type(self.state)
)
)
if self.city:
attribute_list.append(
x509.NameAttribute(NameOID.LOCALITY_NAME, text_type(self.city))
)
if self.email_id:
attribute_list.append(
x509.NameAttribute(
NameOID.EMAIL_ADDRESS, text_type(self.email_id)
)
)
return x509.Name(attribute_list)