def testAesEncryptedKeyDecrypt(self):
   file_reader = readers.FileReader(os.path.join(TEST_DATA, "aes-crypted"))
   key_decrypter = keyczar.Crypter.Read(os.path.join(TEST_DATA, "aes"))
   reader = readers.EncryptedReader(file_reader, key_decrypter)
   self.__testDecrypt("aes-crypted", reader)
   self.__testDecryptReflowed("aes-crypted", reader)
   self.__testAllModesAndBufferSizes(self.__testDecryptStream,
                                     ("aes-crypted", reader,),
                                     no_data_reqd=True)
示例#2
0
    def Read(location):
        """
    Return an UnversionedSigner object created from FileReader at
    given location.

    @param location: pathname of the directory storing the key files
    @type location: string

    @return: a Signer to manage the keys stored at the given location and
      perform sign and verify functions.
    @rtype: L{Signer}
    """
        return UnversionedSigner(readers.FileReader(location))
示例#3
0
 def __init__(self, keyname, *args, **kwargs):
     self.keydata = readers.FileReader(keyname)
     self.crypter = keyczar.Crypter(self.keydata)