ee_cert.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:ctutlz 作者: theno 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号