code: def unlock(self, password = None, keyfile = None, buf = None):
          
  
          if ((password is None or password == "") and (keyfile is None or
               keyfile == "")):
              raise KPError("A password/keyfile is needed")
          elif ((type(password) is not str and password is not None) or
                (type(keyfile) is not str and keyfile is not None)):
              raise KPError("password/keyfile must be a string.")
          if keyfile == "":
              keyfile = None
          if password == "":
              password = None
          self.password = password
          self.keyfile = keyfile
          return self.load(buf)
docs: Unlock the database.
          
          masterkey is needed.