Exemplo n.º 1
0
	def downloadInfo(self):
		""" Displays the information about the download """

		self.story.append(Paragraph("Download Information",styles['Heading1']))
		
		d = DbInterface.getDownload(self.t)
		zipVerification = Verifier(self.t).verifyZIP()
		mbSize = float(d.finalFileSize) / math.pow(2,20)

		startT = str(timezone.localtime(d.downTime))
		endT = str(timezone.localtime(d.endDownTime))

		data = []
		data.append([Paragraph("Start Time: <b>" + startT + "</b>",self.normalStyle)])
		data.append([Paragraph("End Time: <b>" + endT + "</b>",self.normalStyle)])
		data.append([Paragraph("Size: <b>" + str(mbSize) + " MB </b>",self.normalStyle)])
		data.append([Paragraph("ZIP Signature Hash: <b>" + d.verificationZIPSignatureHash + " (" + zipVerification['zipHashBase64']  + ")</b>",self.normalStyle)])
		data.append([Paragraph("Digital Timestamp Authoritiy: <b>" + str("https://www.digistamp.com")+ "</b>",self.normalStyle)])

		t = Table(data)
		t.setStyle(TableStyle([('INNERGRID', (0,0), (-1,-1), 0.25, colors.black),
				       ('BOX', (0,0), (-1,-1), 0.25, colors.black),
				      ]
				     )
			)

		self.story.append(t)
Exemplo n.º 2
0
	def verifyZIP(self):
		""" Verify the signature and the digital timestamp """
		
		d = DbInterface.getDownload(self.t)
		folderName = d.folder

		#path of signature files
		request = os.path.join(settings.VERIFIED_ZIP,folderName+constConfig.EXTENSION_REQUEST)
		signature = os.path.join(settings.VERIFIED_ZIP,folderName+constConfig.EXTENSION_SIGNATURE)
		zipData = os.path.join(settings.VERIFIED_ZIP,folderName+constConfig.EXTENSION_ZIP)

		zipHash = d.verificationZIPSignatureHash
		zipHashBase64 = binascii.b2a_base64(binascii.unhexlify(zipHash))
		signatureDownloadPath = "/verSign/" + folderName + constConfig.EXTENSION_SIGNATURE				

		if os.path.isfile(request) and os.path.isfile(signature):
			dtaVer = DTAVerifier(None)
			res = dtaVer.verifyTimestamp(request,signature)
			return {'res':res,'zipHashBase64':zipHashBase64,'zipHash':zipHash,'downLink': signatureDownloadPath ,'reqName': folderName+constConfig.EXTENSION_REQUEST,'sigName':folderName+constConfig.EXTENSION_SIGNATURE}
Exemplo n.º 3
0
    def downloadInfo(self):
        """ Displays the information about the download """

        self.story.append(Paragraph("Download Information",
                                    styles['Heading1']))

        d = DbInterface.getDownload(self.t)
        zipVerification = Verifier(self.t).verifyZIP()
        mbSize = float(d.finalFileSize) / math.pow(2, 20)

        startT = str(timezone.localtime(d.downTime))
        endT = str(timezone.localtime(d.endDownTime))

        data = []
        data.append(
            [Paragraph("Start Time: <b>" + startT + "</b>", self.normalStyle)])
        data.append(
            [Paragraph("End Time: <b>" + endT + "</b>", self.normalStyle)])
        data.append([
            Paragraph("Size: <b>" + str(mbSize) + " MB </b>", self.normalStyle)
        ])
        data.append([
            Paragraph(
                "ZIP Signature Hash: <b>" + d.verificationZIPSignatureHash +
                " (" + zipVerification['zipHashBase64'] + ")</b>",
                self.normalStyle)
        ])
        data.append([
            Paragraph(
                "Digital Timestamp Authoritiy: <b>" +
                str("https://www.digistamp.com") + "</b>", self.normalStyle)
        ])

        t = Table(data)
        t.setStyle(
            TableStyle([
                ('INNERGRID', (0, 0), (-1, -1), 0.25, colors.black),
                ('BOX', (0, 0), (-1, -1), 0.25, colors.black),
            ]))

        self.story.append(t)