[Checkins] SVN: z3c.keyserver/trunk/ This is the first design of a key server than can be used for

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Jun 27 12:05:14 EDT 2008


Log message for revision 87831:
  This is the first design of a key server than can be used for 
  encryption. Right now, I only have a doctest written outlining the APIs.
  
  

Changed:
  A   z3c.keyserver/trunk/
  A   z3c.keyserver/trunk/.installed.cfg
  A   z3c.keyserver/trunk/CHANGES.txt
  A   z3c.keyserver/trunk/README.txt
  A   z3c.keyserver/trunk/bootstrap.py
  A   z3c.keyserver/trunk/buildout.cfg
  A   z3c.keyserver/trunk/setup.py
  A   z3c.keyserver/trunk/src/
  A   z3c.keyserver/trunk/src/z3c/
  A   z3c.keyserver/trunk/src/z3c/__init__.py
  A   z3c.keyserver/trunk/src/z3c/keyserver/
  A   z3c.keyserver/trunk/src/z3c/keyserver/README.txt
  A   z3c.keyserver/trunk/src/z3c/keyserver/__init__.py
  A   z3c.keyserver/trunk/src/z3c/keyserver/configure.zcml
  A   z3c.keyserver/trunk/src/z3c/keyserver/interfaces.py
  A   z3c.keyserver/trunk/src/z3c/keyserver/server.py
  A   z3c.keyserver/trunk/src/z3c/keyserver/testing.py
  A   z3c.keyserver/trunk/src/z3c/keyserver/tests.py

-=-
Added: z3c.keyserver/trunk/.installed.cfg
===================================================================
--- z3c.keyserver/trunk/.installed.cfg	                        (rev 0)
+++ z3c.keyserver/trunk/.installed.cfg	2008-06-27 16:05:14 UTC (rev 87831)
@@ -0,0 +1,70 @@
+[buildout]
+installed_develop_eggs = /opt/zope/packages/z3c.encryptedpersistent/develop-eggs/z3c.encryptedpersistent.egg-link
+parts = test checker coverage-test coverage-report
+
+[test]
+__buildout_installed__ = /opt/zope/packages/z3c.encryptedpersistent/parts/test
+	/opt/zope/packages/z3c.encryptedpersistent/bin/test
+__buildout_signature__ = zc.recipe.testrunner-1.0.0-py2.5.egg zc.recipe.egg-1.0.0-py2.5.egg setuptools-0.6c8-py2.5.egg zope.testing-3.5.1-py2.5.egg zc.buildout-1.0.6-py2.5.egg zc.buildout-1.0.6-py2.5.egg
+_b = /opt/zope/packages/z3c.encryptedpersistent/bin
+_d = /opt/zope/packages/z3c.encryptedpersistent/develop-eggs
+_e = /opt/zope/packages/eggs
+bin-directory = /opt/zope/packages/z3c.encryptedpersistent/bin
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+develop-eggs-directory = /opt/zope/packages/z3c.encryptedpersistent/develop-eggs
+eggs = z3c.encryptedpersistent [test]
+eggs-directory = /opt/zope/packages/eggs
+executable = /usr/bin/py25
+index = http://pypi.python.org/simple
+location = /opt/zope/packages/z3c.encryptedpersistent/parts/test
+recipe = zc.recipe.testrunner
+script = /opt/zope/packages/z3c.encryptedpersistent/bin/test
+
+[checker]
+__buildout_installed__ = bin/importchecker
+__buildout_signature__ = lovely.recipe-0.3.1b1-py2.5.egg ZConfig-2.5.1-py2.5.egg zc.zodbrecipes-0.4.0-py2.5.egg zc.zope3recipes-0.7.0-py2.5.egg zope.app.locales-3.4.4-py2.5.egg zc.recipe.egg-1.0.0-py2.5.egg zc.buildout-1.0.6-py2.5.egg setuptools-0.6c8-py2.5.egg ZConfig-2.5.1-py2.5.egg zope.testing-3.5.1-py2.5.egg ZConfig-2.5.1-py2.5.egg zope.tal-3.4.1-py2.5.egg zope.interface-3.4.1-py2.5-linux-i686.egg zope.i18nmessageid-3.4.3-py2.5-linux-i686.egg zope.app.appsetup-3.4.1-py2.5.egg zope.app.applicationcontrol-3.4.1-py2.5.egg zc.buildout-1.0.6-py2.5.egg ZODB3-3.9.0_dev_r77011-py2.5-linux-i686.egg zope.traversing-3.5.0a3-py2.5.egg zope.security-3.5.1-py2.5-linux-i686.egg zope.event-3.4.0-py2.5.egg zope.error-3.5.1-py2.5.egg zope.configuration-3.4.0-py2.5.egg zope.component-3.4.0-py2.5.egg zope.app.publication-3.4.3-py2.5.egg zope.app.folder-3.4.0-py2.5.egg zope.app.container-3.6.0-py2.5-linux-i686.egg zope.app.component-3.4.1-py2.5.egg zope.size-3.4.0-py2.5.egg zope.i18n-3.4.0-py2.5.egg zdaemon-2.0.2-py2.5.egg zope.proxy-3.4.0-py2.5-linux-i686.egg zope.publisher-3.5.2-py2.5.egg zope.schema-3.4.0-py2.5.egg zope.location-3.4.0-py2.5.egg zope.exceptions-3.5.2-py2.5.egg zope.deferredimport-3.4.0-py2.5.egg pytz-2008b-py2.5.egg zope.deprecation-3.4.0-py2.5.egg zope.app.security-3.5.1-py2.5.egg zope.app.exception-3.4.1-py2.5.egg zope.app.error-3.5.1-py2.5.egg zope.app.http-3.4.1-py2.5.egg zope.app.authentication-3.4.1-py2.5.egg zope.dublincore-3.4.0-py2.5.egg zope.datetime-3.4.0-py2.5.egg zope.copypastemove-3.4.0-py2.5.egg zope.app.broken-3.4.0-py2.5.egg zope.filerepresentation-3.4.0-py2.5.egg zope.lifecycleevent-3.4.0-py2.5.egg zope.dottedname-3.4.2-py2.5.egg zope.cachedescriptors-3.4.1-py2.5.egg zope.app.publisher-3.5.0a4-py2.5.egg zope.thread-3.4-py2.5.egg zope.location-3.4.0-py2.5.egg zope.formlib-3.4.0-py2.5.egg zope.component-3.4.0-py2.5.egg zope.app.pagetemplate-3.4.0-py2.5.egg zope.app.interface-3.4.0-py2.5.egg zope.annotation-3.4.0-py2.5.egg zope.component-3.4.0-py2.5.egg zope.proxy-3.4.0-py2.5-linux-i686.egg zope.app.form-3.4.2-py2.5.egg zope.app.zapi-3.4.0-py2.5.egg zope.app.session-3.5.1-py2.5.egg zope.app.testing-3.4.2-py2.5.egg zope.app.principalannotation-3.4.0-py2.5.egg zope.pagetemplate-3.4.0-py2.5.egg zope.contenttype-3.4.0-py2.5.egg zope.app.zcmlfiles-3.4.3-py2.5.egg zope.hookable-3.4.0-py2.5-linux-i686.egg zope.tales-3.4.0-py2.5.egg zope.security-3.5.1-py2.5-linux-i686.egg zodbcode-3.4.0-py2.5.egg zope.location-3.4.0-py2.5.egg zope.app.basicskin-3.4.0-py2.5.egg zope.session-3.5.1-py2.5.egg zope.minmax-1.1.0-py2.5.egg zope.app.dependable-3.4.0-py2.5.egg zope.app.debug-3.4.1-py2.5.egg zope.app.schema-3.4.0-py2.5.egg zope.app.wsgi-3.4.0-py2.5.egg zope.app.rotterdam-3.4.1-py2.5.egg zope.app.zopeappgenerations-3.4.0-py2.5.egg zope.app.i18n-3.4.4-py2.5.egg zope.app.generations-3.4.1-py2.5.egg zope.app.content-3.4.0-py2.5.egg zope.modulealias-3.4.0-py2.5.egg RestrictedPython-3.4.2-py2.5.egg zope.app.renderer-3.4.0-py2.5.egg zope.structuredtext-3.4.0-py2.5.egg docutils-0.4-py2.5.egg
+_b = /opt/zope/packages/z3c.encryptedpersistent/bin
+_d = /opt/zope/packages/z3c.encryptedpersistent/develop-eggs
+_e = /opt/zope/packages/eggs
+bin-directory = /opt/zope/packages/z3c.encryptedpersistent/bin
+develop-eggs-directory = /opt/zope/packages/z3c.encryptedpersistent/develop-eggs
+eggs = 
+eggs-directory = /opt/zope/packages/eggs
+executable = /usr/bin/py25
+index = http://pypi.python.org/simple
+path = src/z3c/encryptedpersistent
+recipe = lovely.recipe:importchecker
+
+[coverage-test]
+__buildout_installed__ = /opt/zope/packages/z3c.encryptedpersistent/parts/coverage-test
+	/opt/zope/packages/z3c.encryptedpersistent/bin/coverage-test
+__buildout_signature__ = zc.recipe.testrunner-1.0.0-py2.5.egg zc.recipe.egg-1.0.0-py2.5.egg setuptools-0.6c8-py2.5.egg zope.testing-3.5.1-py2.5.egg zc.buildout-1.0.6-py2.5.egg zc.buildout-1.0.6-py2.5.egg
+_b = /opt/zope/packages/z3c.encryptedpersistent/bin
+_d = /opt/zope/packages/z3c.encryptedpersistent/develop-eggs
+_e = /opt/zope/packages/eggs
+bin-directory = /opt/zope/packages/z3c.encryptedpersistent/bin
+defaults = ['--coverage', '../../coverage']
+develop-eggs-directory = /opt/zope/packages/z3c.encryptedpersistent/develop-eggs
+eggs = z3c.encryptedpersistent [test]
+eggs-directory = /opt/zope/packages/eggs
+executable = /usr/bin/py25
+index = http://pypi.python.org/simple
+location = /opt/zope/packages/z3c.encryptedpersistent/parts/coverage-test
+recipe = zc.recipe.testrunner
+script = /opt/zope/packages/z3c.encryptedpersistent/bin/coverage-test
+
+[coverage-report]
+__buildout_installed__ = /opt/zope/packages/z3c.encryptedpersistent/bin/coverage-report
+__buildout_signature__ = zc.recipe.egg-1.0.0-py2.5.egg setuptools-0.6c8-py2.5.egg zc.buildout-1.0.6-py2.5.egg
+_b = /opt/zope/packages/z3c.encryptedpersistent/bin
+_d = /opt/zope/packages/z3c.encryptedpersistent/develop-eggs
+_e = /opt/zope/packages/eggs
+arguments = ('coverage', 'coverage/report')
+bin-directory = /opt/zope/packages/z3c.encryptedpersistent/bin
+develop-eggs-directory = /opt/zope/packages/z3c.encryptedpersistent/develop-eggs
+eggs = z3c.coverage
+eggs-directory = /opt/zope/packages/eggs
+executable = /usr/bin/py25
+index = http://pypi.python.org/simple
+recipe = zc.recipe.egg
+scripts = coverage=coverage-report

Added: z3c.keyserver/trunk/CHANGES.txt
===================================================================
--- z3c.keyserver/trunk/CHANGES.txt	                        (rev 0)
+++ z3c.keyserver/trunk/CHANGES.txt	2008-06-27 16:05:14 UTC (rev 87831)
@@ -0,0 +1,9 @@
+=======
+CHANGES
+=======
+
+
+0.1.0 (2008-??-??)
+------------------
+
+- Initial Release


Property changes on: z3c.keyserver/trunk/CHANGES.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.keyserver/trunk/README.txt
===================================================================
--- z3c.keyserver/trunk/README.txt	                        (rev 0)
+++ z3c.keyserver/trunk/README.txt	2008-06-27 16:05:14 UTC (rev 87831)
@@ -0,0 +1 @@
+A NIST SP 800-57 compliant encryption key server.


Property changes on: z3c.keyserver/trunk/README.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.keyserver/trunk/bootstrap.py
===================================================================
--- z3c.keyserver/trunk/bootstrap.py	                        (rev 0)
+++ z3c.keyserver/trunk/bootstrap.py	2008-06-27 16:05:14 UTC (rev 87831)
@@ -0,0 +1,52 @@
+##############################################################################
+#
+# Copyright (c) 2008 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id$
+"""
+
+import os, shutil, sys, tempfile, urllib2
+
+tmpeggs = tempfile.mkdtemp()
+
+ez = {}
+exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                     ).read() in ez
+ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+import pkg_resources
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+if sys.platform == 'win32':
+    cmd = '"%s"' % cmd # work around spawn lamosity on windows
+
+ws = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, sys.executable,
+    '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+shutil.rmtree(tmpeggs)


Property changes on: z3c.keyserver/trunk/bootstrap.py
___________________________________________________________________
Name: svn:keywords
   + Id

Added: z3c.keyserver/trunk/buildout.cfg
===================================================================
--- z3c.keyserver/trunk/buildout.cfg	                        (rev 0)
+++ z3c.keyserver/trunk/buildout.cfg	2008-06-27 16:05:14 UTC (rev 87831)
@@ -0,0 +1,22 @@
+[buildout]
+develop = .
+parts = test coverage-test coverage-report
+
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = z3c.encryptedpersistent [test]
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+
+[coverage-test]
+recipe = zc.recipe.testrunner
+eggs = z3c.encryptedpersistent [test]
+defaults = ['--coverage', '../../coverage']
+
+
+[coverage-report]
+recipe = zc.recipe.egg
+eggs = z3c.coverage
+scripts = coverage=coverage-report
+arguments = ('coverage', 'coverage/report')

Added: z3c.keyserver/trunk/setup.py
===================================================================
--- z3c.keyserver/trunk/setup.py	                        (rev 0)
+++ z3c.keyserver/trunk/setup.py	2008-06-27 16:05:14 UTC (rev 87831)
@@ -0,0 +1,64 @@
+##############################################################################
+#
+# Copyright (c) 2008 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id$
+"""
+
+import os
+from setuptools import setup, find_packages
+
+def read(*rnames):
+    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+setup (
+    name='z3c.keyserver',
+    version='0.0.1dev',
+    author = "Stephan Richter, Randy Crafton and the Zope Community",
+    author_email = "zope-dev at zope.org",
+    description = "A Key Management Server",
+    long_description=(
+        read('README.txt')
+        + '\n\n' +
+        read('CHANGES.txt')
+        ),
+    license = "ZPL 2.1",
+    keywords = "zope3 security key management server nist 800-57",
+    classifiers = [
+        'Development Status :: 4 - Beta',
+        'Environment :: Web Environment',
+        'Intended Audience :: Developers',
+        'License :: OSI Approved :: Zope Public License',
+        'Programming Language :: Python',
+        'Natural Language :: English',
+        'Operating System :: OS Independent',
+        'Topic :: Internet :: WWW/HTTP',
+        'Framework :: Zope3'],
+    url = 'http://pypi.python.org/pypi/z3c.keyserver',
+    packages = find_packages('src'),
+    include_package_data = True,
+    package_dir = {'':'src'},
+    namespace_packages = ['z3c'],
+    extras_require = dict(
+        test = [
+            'zope.testing',
+            ],
+        ),
+    install_requires = [
+        'setuptools',
+        'zope.component',
+        'zope.interface',
+        'zope.schema',
+        ],
+    zip_safe = False,
+)


Property changes on: z3c.keyserver/trunk/setup.py
___________________________________________________________________
Name: svn:keywords
   + Id

Added: z3c.keyserver/trunk/src/z3c/__init__.py
===================================================================
--- z3c.keyserver/trunk/src/z3c/__init__.py	                        (rev 0)
+++ z3c.keyserver/trunk/src/z3c/__init__.py	2008-06-27 16:05:14 UTC (rev 87831)
@@ -0,0 +1,7 @@
+# this is a namespace package
+try:
+    import pkg_resources
+    pkg_resources.declare_namespace(__name__)
+except ImportError:
+    import pkgutil
+    __path__ = pkgutil.extend_path(__path__, __name__)
\ No newline at end of file


Property changes on: z3c.keyserver/trunk/src/z3c/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Added: z3c.keyserver/trunk/src/z3c/keyserver/README.txt
===================================================================
--- z3c.keyserver/trunk/src/z3c/keyserver/README.txt	                        (rev 0)
+++ z3c.keyserver/trunk/src/z3c/keyserver/README.txt	2008-06-27 16:05:14 UTC (rev 87831)
@@ -0,0 +1,130 @@
+=====================
+Key Management Server
+=====================
+
+This package provides a NIST SP 800-57 compliant key management server.
+
+  >>> from z3c.keyserver import server
+
+In order to ensure the highest level of compliance, the key management server
+and server storing the data cannot be the same machine. Next, the key used to
+en- and decrypt the data cannot be stored in plain format, but must also be
+encrypted for storage using a key of equal and better strength.
+
+The workflow to create a new encryption key.
+
+1. Create the key encryption key (private and public).
+
+2. Create the encryption key (private and public).
+
+3. Use the private key encryption key to encrypt both, the private and public,
+   encryption key.
+
+4. Discard the private key encryption key.
+
+5. Store the encrypted private and public encryption key on the server.
+
+6. Return the public key encryption key.
+
+So let's create a key management server:
+
+  >>> keys = server.KeyServer()
+  >>> keys
+  <KeyServer (0)>
+
+  # Later show attributes
+
+ and generate a key:
+
+  >>> key = keys.generate()
+  >>> key
+
+You can now use this key encryption key to extract the encryption keys:
+
+  >>> keys.get(key)
+
+You can also ask the key server to encrypt a string directly. This
+functionality is provided by the ``IEnryption`` interface:
+
+  >>> from zope.interface import verify
+  >>> from z3c.keyserver import interfaces
+  >>> verify.verifyObject(interfaces.IEncryption, keys)
+  True
+
+Let's now encrypt some data:
+
+  >>> encrypted = keys.encrypt(key, 'Stephan Richter')
+  >>> encrypted
+
+We can also decrypt the data.
+
+  >>> keys.decrypt(key, encrypted)
+  'Stephan Richter'
+
+
+And that's pretty much all there is to it. Most of the complicated
+crypto-related work happens under the hood, transparent to the user.
+
+
+The Key Client
+--------------
+
+In order to access the key server remotely, we define a simple XML-RPC API to
+communicate the keys. We do not make the server responsible for doing the
+actual encryption and decryption, so that the key server does not become a
+resource bottle neck. A simple component is wrapped around the XML-RPC call:
+
+  >>> from z3c.keyserver import cient
+  >>> remoteKeys = client.KeyClient('http://localhost/keys')
+  >>> remoteKeys
+  <KeyClient 'http://localhost/keys'>
+
+In order to make this work in this test we'll setup a fake connection:
+
+  >>> from z3c.keyserver import testing
+  >>> testing.setUpRPC(remoteKeys, keys)
+
+As with the server, the client implements the ``IEncryption`` interfaces:
+
+  >>> verify.verifyObject(interfaces.IEncryption, remoteKeys)
+  True
+
+So en- and decryption is very easy to do:
+
+  >>> encrypted = remoteKeys.encrypt(key, 'Stephan Richter')
+  >>> encrypted
+
+  >>> remoteKeys.decrypt(key, encrypted)
+  'Stephan Richter'
+
+Of course, the client does not fetch the keys for every call. Instead, they
+are cached on the client locally:
+
+  >>> key in remoteKeys._cache
+  True
+
+A timeout (in seconds) controlls when a key must be refetched:
+
+  >>> remoteKeys.timeout
+  3600
+
+Let's now force a reload by setting the timeout to zero:
+
+  >>> remoteKeys.timeout = 0
+
+  >>> firstTime = remoteKeys._cache[key][0]
+  remoteKeys.decrypt(key, encrypted)
+  >>> secondTime = remoteKeys._cache[key][0]
+
+  >>> firstTime < secondTime
+  True
+
+The client can of course also ask the key server to generate a key:
+
+  >>> key2 = remoteKeys.generate()
+  >>> key2
+
+The key should be immediately available on the server:
+
+  >>> key2 in keys
+  True


Property changes on: z3c.keyserver/trunk/src/z3c/keyserver/README.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.keyserver/trunk/src/z3c/keyserver/__init__.py
===================================================================
--- z3c.keyserver/trunk/src/z3c/keyserver/__init__.py	                        (rev 0)
+++ z3c.keyserver/trunk/src/z3c/keyserver/__init__.py	2008-06-27 16:05:14 UTC (rev 87831)
@@ -0,0 +1,17 @@
+##############################################################################
+#
+# Copyright (c) 2008 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id$
+"""
+


Property changes on: z3c.keyserver/trunk/src/z3c/keyserver/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Added: z3c.keyserver/trunk/src/z3c/keyserver/configure.zcml
===================================================================
--- z3c.keyserver/trunk/src/z3c/keyserver/configure.zcml	                        (rev 0)
+++ z3c.keyserver/trunk/src/z3c/keyserver/configure.zcml	2008-06-27 16:05:14 UTC (rev 87831)
@@ -0,0 +1,7 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    i18n_domain="z3c">
+
+
+
+</configure>
\ No newline at end of file


Property changes on: z3c.keyserver/trunk/src/z3c/keyserver/configure.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.keyserver/trunk/src/z3c/keyserver/interfaces.py
===================================================================
--- z3c.keyserver/trunk/src/z3c/keyserver/interfaces.py	                        (rev 0)
+++ z3c.keyserver/trunk/src/z3c/keyserver/interfaces.py	2008-06-27 16:05:14 UTC (rev 87831)
@@ -0,0 +1,53 @@
+##############################################################################
+#
+# Copyright (c) 2008 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id$
+"""
+__docformat__ = "reStructuredText"
+import zope.interface
+import zope.schema
+from zope.app.container import interfaces
+
+class IEncryption(zope.interface.Interface):
+    """Utility providing encryption mechanism"""
+
+    def encrypt(key, data):
+        """Returns the encrypted data"""
+
+    def decrypt(key, data):
+        """Returns the decrypted data"""
+
+
+class IKeyGeneration(zope.interface.Interface):
+    """A component that can generate a key encryption pair."""
+
+    def generate():
+        """Generate a new set of keys.
+
+        Returns the public key encryption key.
+        """
+
+class IKeyServer(IEncryption, IKeyGeneration, interfaces.IContainer):
+    """A Key Management Server."""
+
+
+class IKeyClient(IEncryption, IKeyGeneration):
+    """A Key Client.
+
+    The container API is not supported:
+
+      1. It would be insecure to allow any client to discover all of the keys.
+
+      2. It would prohibit certain optimizations in caching.
+    """


Property changes on: z3c.keyserver/trunk/src/z3c/keyserver/interfaces.py
___________________________________________________________________
Name: svn:keywords
   + Id

Added: z3c.keyserver/trunk/src/z3c/keyserver/server.py
===================================================================
--- z3c.keyserver/trunk/src/z3c/keyserver/server.py	                        (rev 0)
+++ z3c.keyserver/trunk/src/z3c/keyserver/server.py	2008-06-27 16:05:14 UTC (rev 87831)
@@ -0,0 +1,19 @@
+##############################################################################
+#
+# Copyright (c) 2008 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id$
+"""
+__docformat__ = "reStructuredText"
+import zope.interface
+from z3c.keyserver import interfaces


Property changes on: z3c.keyserver/trunk/src/z3c/keyserver/server.py
___________________________________________________________________
Name: svn:keywords
   + Id

Added: z3c.keyserver/trunk/src/z3c/keyserver/testing.py
===================================================================
--- z3c.keyserver/trunk/src/z3c/keyserver/testing.py	                        (rev 0)
+++ z3c.keyserver/trunk/src/z3c/keyserver/testing.py	2008-06-27 16:05:14 UTC (rev 87831)
@@ -0,0 +1,16 @@
+##############################################################################
+#
+# Copyright (c) 2008 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id$
+"""


Property changes on: z3c.keyserver/trunk/src/z3c/keyserver/testing.py
___________________________________________________________________
Name: svn:keywords
   + Id

Added: z3c.keyserver/trunk/src/z3c/keyserver/tests.py
===================================================================
--- z3c.keyserver/trunk/src/z3c/keyserver/tests.py	                        (rev 0)
+++ z3c.keyserver/trunk/src/z3c/keyserver/tests.py	2008-06-27 16:05:14 UTC (rev 87831)
@@ -0,0 +1,28 @@
+##############################################################################
+#
+# Copyright (c) 2008 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id$
+"""
+import unittest
+import doctest
+from zope.testing.doctestunit import DocFileSuite
+from zope.app.testing import placelesssetup
+
+def test_suite():
+    return unittest.TestSuite((
+        DocFileSuite(
+            'README.txt',
+            setUp=placelesssetup.setUp, tearDown=placelesssetup.tearDown,
+            optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS),
+        ))


Property changes on: z3c.keyserver/trunk/src/z3c/keyserver/tests.py
___________________________________________________________________
Name: svn:keywords
   + Id



More information about the Checkins mailing list