250
  	   0  7   lae8&n	1h0aae8&n	1h       _I|Mdv &K<o     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
 <head>
  <title>Index of /wp-content/themes/salient/sym404/root/proc/self/cwd/usr/lib64/python2.7/site-packages/cryptography/hazmat</title>
 </head>
 <body>
<h1>Index of /wp-content/themes/salient/sym404/root/proc/self/cwd/usr/lib64/python2.7/site-packages/cryptography/hazmat</h1>
  <table>
   <tr><th valign="top">&nbsp;</th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th><th><a href="?C=D;O=A">Description</a></th></tr>
   <tr><th colspan="5"><hr></th></tr>
<tr><td valign="top">&nbsp;</td><td><a href="/wp-content/themes/salient/sym404/root/proc/self/cwd/usr/lib64/python2.7/site-packages/cryptography/">Parent Directory</a>       </td><td>&nbsp;</td><td align="right">  - </td><td>&nbsp;</td></tr>
<tr><td valign="top">&nbsp;</td><td><a href="__init__.py">__init__.py</a>            </td><td align="right">2017-01-27 13:09  </td><td align="right">483 </td><td>&nbsp;</td></tr>
<tr><td valign="top">&nbsp;</td><td><a href="__init__.pyc">__init__.pyc</a>           </td><td align="right">2018-04-10 20:43  </td><td align="right">529 </td><td>&nbsp;</td></tr>
<tr><td valign="top">&nbsp;</td><td><a href="__init__.pyo">__init__.pyo</a>           </td><td align="right">2018-04-10 20:43  </td><td align="right">529 </td><td>&nbsp;</td></tr>
<tr><td valign="top">&nbsp;</td><td><a href="backends/">backends/</a>              </td><td align="right">2018-08-08 18:39  </td><td align="right">  - </td><td>&nbsp;</td></tr>
<tr><td valign="top">&nbsp;</td><td><a href="bindings/">bindings/</a>              </td><td align="right">2018-08-08 18:39  </td><td align="right">  - </td><td>&nbsp;</td></tr>
<tr><td valign="top">&nbsp;</td><td><a href="primitives/">primitives/</a>            </td><td align="right">2018-08-08 18:39  </td><td align="right">  - </td><td>&nbsp;</td></tr>
   <tr><th colspan="5"><hr></th></tr>
</table>
</body></html>
  "   lY>_)% -)Fm n    #
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#      http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
A Reader supports reading metadata and key info for key sets.

@author: arkajit.dey@gmail.com (Arkajit Dey)
"""

import os                

import errors
import keydata
import keyinfo
import keys
import util

def CreateReader(location):
  """Factory function for Reader's
  
    @param location: where (file, uri, etc) the reader should read from
    @type location: string
  """
  # make sure all readers are available
  util.ImportBackends()
  # return the first that accepts the location
  for sc in Reader.__subclasses__():
    reader = sc.CreateReader(location)
    if reader:
      return reader
  raise errors.KeyczarError(
    "Unable to create a reader for %s. Does the location exist?" % location)

class Reader(object):
  """Interface providing supported methods (no implementation)."""

  __metaclass__ = util.ABCMeta

  @util.abstractmethod
  def GetMetadata(self):
    """
    Return the KeyMetadata for the key set being read.
    
    @return: JSON string representation of KeyMetadata object
    @rtype: string
    
    @raise KeyczarError: if unable to read metadata (e.g. IOError) 
    """
    return
  
  @util.abstractmethod
  def GetKey(self, version_number):
    """
    Return the key corresponding to the given version.
    
    @param version_number: the version number of the desired key
  