'Sign a SAML statement.
:param statement: The statement to be signed
:param node_name: string like \'urn:oasis:names:...:Assertion\'
:param key: The key to be used for the signing, either this or
:param key_file: The file where the key can be found
:param node_id:
:param id_attr: The attribute name for the identifier, normally one of
\'id\',\'Id\' or \'ID\'
:return: The signed statement'

def sign_statement(self, statement, node_name, key=None, key_file=None, node_id=None, id_attr='', passphrase=None):

    if (not id_attr):
        id_attr = ID_ATTR
    if ((not key_file) and key):
        (_, key_file) = make_temp(('%s' % key), '.pem')
    if ((not key) and (not key_file)):
        key_file = self.key_file
    if (not passphrase):
        passphrase = self.key_file_passphrase
    return self.crypto.sign_statement(statement, node_name, key_file, node_id, id_attr, passphrase=passphrase)
