Back to index

plone3  3.1.7
interfaces.py
Go to the documentation of this file.
00001 from zope.interface import Attribute
00002 from zope.app.container.interfaces import IContainer
00003 from zope.app.container.interfaces import IContained
00004 from zope.interface.common.sequence import IFiniteSequence
00005 from zope.app.container.constraints import contains
00006 
00007 
00008 class IKeyManager(IContainer):
00009     contains("plone.keyring.interfaces.IKeyring")
00010 
00011     def clear(ring=u"_system"):
00012         """Clear all keys on a given ring. By default the system ring
00013         is cleader.  If None is used as ring id all rings are cleared.
00014         """
00015 
00016     def rotate(ring=u"_system"):
00017         """Rotate a given ring. By default rotates the system ring.
00018         If None is used as ring id all rings are rotated.
00019         """
00020 
00021     def secret(ring=u"_system"):
00022         """Return the current secret for a given ring. If no ring
00023         is given the secret for the system ring is returned"""
00024         
00025 
00026 
00027 class IKeyring(IContained, IFiniteSequence):
00028     current = Attribute("The current (ie latest) secret in the ring.")
00029 
00030     def __init__(size=5):
00031         """Construct a new keyring for a specified number of keys.
00032         """
00033 
00034     def clear():
00035         """Remove all keys from the ring.
00036         """
00037 
00038     def rotate():
00039         """Add a new secret to the ring, pushing out the oldest secret.
00040         """
00041