本文整理汇总了Python中pureber.berDecodeMultiple函数的典型用法代码示例。如果您正苦于以下问题:Python berDecodeMultiple函数的具体用法?Python berDecodeMultiple怎么用?Python berDecodeMultiple使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了berDecodeMultiple函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fromBER
def fromBER(klass, tag, content, berdecoder=None):
l = berDecodeMultiple(content, LDAPBERDecoderContext_BindResponse(
fallback=berdecoder))
assert 3<=len(l)<=4
try:
if isinstance(l[0], LDAPBindResponse_serverSaslCreds):
serverSaslCreds=l[0]
del l[0]
else:
serverSaslCreds=None
except IndexError:
serverSaslCreds=None
referral = None
#if (l[3:] and isinstance(l[3], LDAPReferral)):
#TODO support referrals
#self.referral=self.data[0]
r = klass(resultCode=l[0].value,
matchedDN=l[1].value,
errorMessage=l[2].value,
referral=referral,
serverSaslCreds=serverSaslCreds,
tag=tag)
return r
示例2: fromBER
def fromBER(klass, tag, content, berdecoder=None):
l = berDecodeMultiple(content, LDAPBERDecoderContext_Compare(fallback=berdecoder, inherit=berdecoder))
r = klass(entry=l[0].value,
ava=l[1],
tag=tag)
return r
示例3: fromBER
def fromBER(klass, tag, content, berdecoder=None):
l = berDecodeMultiple(content,
LDAPBERDecoderContext_LDAPBindRequest(
fallback=berdecoder))
sasl = False
auth = None
if isinstance(l[2], BEROctetString):
auth = l[2].value
elif isinstance(l[2], BERSequence):
auth = (l[2][0].value, l[2][1].value)
sasl = True
r = klass(version=l[0].value,
dn=l[1].value,
auth=auth,
tag=tag,
sasl=sasl)
return r