当前位置: 首页>>代码示例>>Python>>正文


Python encoder.OctetStringEncoder方法代码示例

本文整理汇总了Python中pyasn1.codec.ber.encoder.OctetStringEncoder方法的典型用法代码示例。如果您正苦于以下问题:Python encoder.OctetStringEncoder方法的具体用法?Python encoder.OctetStringEncoder怎么用?Python encoder.OctetStringEncoder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyasn1.codec.ber.encoder的用法示例。


在下文中一共展示了encoder.OctetStringEncoder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: encodeValue

# 需要导入模块: from pyasn1.codec.ber import encoder [as 别名]
# 或者: from pyasn1.codec.ber.encoder import OctetStringEncoder [as 别名]
def encodeValue(self, encodeFun, client, defMode, maxChunkSize):
        return encoder.OctetStringEncoder.encodeValue(
            self, encodeFun, client, defMode, 1000
        ) 
开发者ID:aliyun,项目名称:oss-ftp,代码行数:6,代码来源:encoder.py

示例2: encodeValue

# 需要导入模块: from pyasn1.codec.ber import encoder [as 别名]
# 或者: from pyasn1.codec.ber.encoder import OctetStringEncoder [as 别名]
def encodeValue(self, value, asn1Spec, encodeFun, **options):
        # Encoding constraints:
        # - minutes are mandatory, seconds are optional
        # - subseconds must NOT be zero
        # - no hanging fraction dot
        # - time in UTC (Z)
        # - only dot is allowed for fractions

        if asn1Spec is not None:
            value = asn1Spec.clone(value)

        octets = value.asOctets()

        if not self.minLength < len(octets) < self.maxLength:
            raise error.PyAsn1Error('Length constraint violated: %r' % value)

        if self.pluschar in octets or self.minuschar in octets:
            raise error.PyAsn1Error('Must be UTC time: %r' % octets)

        if octets[-1] != self.zchar:
            raise error.PyAsn1Error('Missing "Z" time zone specifier: %r' % octets)

        if self.commachar in octets:
            raise error.PyAsn1Error('Comma in fractions disallowed: %r' % value)

        options.update(maxChunkSize=1000)

        return encoder.OctetStringEncoder.encodeValue(
            self, value, asn1Spec, encodeFun, **options
        ) 
开发者ID:tp4a,项目名称:teleport,代码行数:32,代码来源:encoder.py

示例3: encodeValue

# 需要导入模块: from pyasn1.codec.ber import encoder [as 别名]
# 或者: from pyasn1.codec.ber.encoder import OctetStringEncoder [as 别名]
def encodeValue(self, encodeFun, client, defMode, maxChunkSize):
        return encoder.OctetStringEncoder.encodeValue(
            self, encodeFun, client, defMode, 1000
            )

# specialized RealEncoder here
# specialized GeneralStringEncoder here
# specialized GeneralizedTimeEncoder here
# specialized UTCTimeEncoder here 
开发者ID:caronc,项目名称:nzb-subliminal,代码行数:11,代码来源:encoder.py

示例4: encodeValue

# 需要导入模块: from pyasn1.codec.ber import encoder [as 别名]
# 或者: from pyasn1.codec.ber.encoder import OctetStringEncoder [as 别名]
def encodeValue(self, value, asn1Spec, encodeFun, **options):
        # Encoding constraints:
        # - minutes are mandatory, seconds are optional
        # - sub-seconds must NOT be zero
        # - no hanging fraction dot
        # - time in UTC (Z)
        # - only dot is allowed for fractions

        if asn1Spec is not None:
            value = asn1Spec.clone(value)

        octets = value.asOctets()

        if not self.minLength < len(octets) < self.maxLength:
            raise error.PyAsn1Error('Length constraint violated: %r' % value)

        if self.pluschar in octets or self.minuschar in octets:
            raise error.PyAsn1Error('Must be UTC time: %r' % octets)

        if octets[-1] != self.zchar:
            raise error.PyAsn1Error('Missing "Z" time zone specifier: %r' % octets)

        if self.commachar in octets:
            raise error.PyAsn1Error('Comma in fractions disallowed: %r' % value)

        options.update(maxChunkSize=1000)

        return encoder.OctetStringEncoder.encodeValue(
            self, value, asn1Spec, encodeFun, **options
        ) 
开发者ID:gkrizek,项目名称:bash-lambda-layer,代码行数:32,代码来源:encoder.py


注:本文中的pyasn1.codec.ber.encoder.OctetStringEncoder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。