示例#1
0
文件: X509Chain.py 项目: vingar/DIRAC
 def __getProxyExtensionList(self,
                             diracGroup=False,
                             rfc=False,
                             rfcLimited=False):
     """
 Get the list of extensions for a proxy
 """
     extList = []
     extList.append(
         crypto.X509Extension(
             'keyUsage',
             'critical, digitalSignature, keyEncipherment, dataEncipherment'
         ))
     if diracGroup and isinstance(diracGroup,
                                  self.__validExtensionValueTypes):
         extList.append(crypto.X509Extension('diracGroup', diracGroup))
     if rfc or rfcLimited:
         blob = [["1.3.6.1.5.5.7.21.1"]
                 ] if not rfcLimited else [["1.3.6.1.4.1.3536.1.1.1.9"]]
         asn1Obj = crypto.ASN1(blob)
         asn1Obj[0][0].convert_to_object()
         asn1dump = binascii.hexlify(asn1Obj.dump())
         extval = "critical,DER:" + ":".join(
             asn1dump[i:i + 2] for i in range(0, len(asn1dump), 2))
         ext = crypto.X509Extension("proxyCertInfo", extval)
         extList.append(ext)
     return extList
示例#2
0
 def __getProxyExtensionList( self, diracGroup = False ):
   """
   Get the list of extensions for a proxy
   """
   extList = []
   extList.append( crypto.X509Extension( 'keyUsage', 'critical, digitalSignature, keyEncipherment, dataEncipherment' ) )
   if diracGroup and type( diracGroup ) in self.__validExtensionValueTypes:
     extList.append( crypto.X509Extension( 'diracGroup', diracGroup ) )
   return extList