Esempio n. 1
0
File: gid.py Progetto: EICT/C-BAS
    def encode(self):
        if self.urn:
            urn = self.urn
        else:
            urn = hrn_to_urn(self.hrn, None)
            
        str = "URI:" + urn

        if self.uuid:
            str += ", " + "URI:" + uuid.UUID(int=self.uuid).urn
        
        if self.email:
            str += ", " + "email:" + self.email

        self.set_data(str, 'subjectAltName')
Esempio n. 2
0
File: gid.py Progetto: EICT/C-BAS
    def __init__(self, create=False, subject=None, string=None, filename=None, uuid=None, hrn=None, urn=None,
                 lifeDays=1825, email=None, serial_number=0):
        self.uuid = None
        self.hrn = None
        self.urn = None
        self.email = None # for adding to the SubjectAltName
        Certificate.__init__(self, lifeDays, create, subject, string, filename, None, serial_number)

        if subject:
            logger.debug("Creating GID for subject: %s" % subject)
        if uuid:
            self.uuid = int(uuid)
        if hrn:
            self.hrn = hrn
            self.urn = hrn_to_urn(hrn, 'unknown')
        if urn:
            self.urn = urn
            self.hrn, type = urn_to_hrn(urn)
        if email:
            self.set_email(email)