codekingpro/portable-devtools
114k
1# This file is being contributed to pyasn1-modules software.2#3# Created by Russ Housley.4# Modified by Russ Housley to add a map for use with opentypes.5#6# Copyright (c) 2019, Vigil Security, LLC7# License: http://snmplabs.com/pyasn1/license.html8#9# BinaryTime: An Alternate Format for Representing Date and Time10#11# ASN.1 source from:12# https://www.rfc-editor.org/rfc/rfc6019.txt13 14from pyasn1.type import constraint15from pyasn1.type import univ16 17from pyasn1_modules import rfc565218 19MAX = float('inf')20 21 22# BinaryTime: Represent date and time as an integer 23 24class BinaryTime(univ.Integer):25 pass26 27BinaryTime.subtypeSpec = constraint.ValueRangeConstraint(0, MAX)28 29 30# CMS Attribute for representing signing time in BinaryTime31 32id_aa_binarySigningTime = univ.ObjectIdentifier('1.2.840.113549.1.9.16.2.46')33 34class BinarySigningTime(BinaryTime):35 pass36 37 38# Map of Attribute Type OIDs to Attributes ia added to the39# ones that are in rfc5652.py40 41_cmsAttributesMapUpdate = {42 id_aa_binarySigningTime: BinarySigningTime(),43}44 45rfc5652.cmsAttributesMap.update(_cmsAttributesMapUpdate)46 