From dc9c305d693eb53c9a45aeacd18569c76c66927c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Fri, 21 Jan 2011 12:33:19 +0000
Subject: [PATCH]  - implement server side getComputerPartitionCertificate

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42572 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/Vifib/Tool/SlapTool.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/product/Vifib/Tool/SlapTool.py b/product/Vifib/Tool/SlapTool.py
index 4a6698cdba..c1f3a422ca 100644
--- a/product/Vifib/Tool/SlapTool.py
+++ b/product/Vifib/Tool/SlapTool.py
@@ -151,6 +151,17 @@ class SlapTool(BaseTool):
           self._convertToSlapPartition(slave_partition_document, computer_id))
     return xml_marshaller.xml_marshaller.dumps(slap_computer)
 
+  security.declareProtected(Permissions.AccessContentsInformation, 'getComputerPartitionCertificate')
+  def getComputerPartitionCertificate(self, computer_id, computer_partition_id):
+    self.REQUEST.response.setHeader('Content-Type', 'text/xml')
+    software_instance = self._getSoftwareInstanceForComputerPartition(
+      computer_id, computer_partition_id)
+    certificate_dict = dict(
+      key=software_instance.getSslKey(),
+      certificate=software_instance.getSslCertificate()
+    )
+    return xml_marshaller.xml_marshaller.dumps(certificate_dict)
+    
   ####################################################
   # Public POST methods
   ####################################################
-- 
2.30.9