encode_asn1.py 文件源码

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

项目:noc-orchestrator 作者: DirceuSilvaLabs 项目源码 文件源码
def _encode_name_entry(backend, attribute):
    value = attribute.value.encode('utf8')
    obj = _txt2obj_gc(backend, attribute.oid.dotted_string)
    if attribute.oid == NameOID.COUNTRY_NAME:
        # Per RFC5280 Appendix A.1 countryName should be encoded as
        # PrintableString, not UTF8String
        type = backend._lib.MBSTRING_ASC
    else:
        type = backend._lib.MBSTRING_UTF8
    name_entry = backend._lib.X509_NAME_ENTRY_create_by_OBJ(
        backend._ffi.NULL, obj, type, value, -1
    )
    return name_entry
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号