(self)
return key.encode("utf8")
Gets the signing key, creating it if necessary.
Gets the signing key, creating it if necessary.
Gets the signing key creating it if necessary .
def get_key(self):
        """Gets the signing key, creating it if necessary."""
        if self.session is None:
            key = self.key
            assert self.key is not None, "You need to specify a signing key"
        else:
            key = self.session.get("_signature_key")
            if key is None:
                key = str(uuid.uuid1())
                self.session["_signature_key"] = key
        return key.encode("utf8")
def get_key ( self ) : if self . session is None : key = self . key assert self . key is not None , "You need to specify a signing key" else : key = self . session . get ( "_signature_key" ) if key is None : key = str ( uuid . uuid1 ( ) ) self . session [ "_signature_key" ] = key return key . encode ( "utf8" )