def is_letsencrypt_cert(ee_cert):
'''Return True if ee_cert was issued by Let's Encrypt.
Args:
ee_cert (EndEntityCert)
'''
organization_name_oid = ObjectIdentifier(value='2.5.4.10')
issuer = ee_cert.tbscert.pyasn1['issuer']
if issuer:
for rdn in issuer['rdnSequence']:
for item in rdn:
if item.getComponentByName('type') == organization_name_oid:
organisation_name = str(item.getComponentByName('value'))
organisation_name = string_without_prefix('\x13\r',
organisation_name)
if organisation_name == "Let's Encrypt":
return True
return False
评论列表
文章目录