'Create an object that represents a SAML <Signature>.
This must be filled with algorithms that the signing binary will apply
in order to sign the whole message.
Currently we enforce X509 signing.
Example of the template::
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<Reference URI="#<Assertion ID>">
<Transforms>
<Transform
Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue />
</Reference>
</SignedInfo>
<SignatureValue />
<KeyInfo>
<X509Data />
</KeyInfo>
</Signature>
:returns: XML <Signature> object'

def _create_signature(self):

    canonicalization_method = xmldsig.CanonicalizationMethod()
    canonicalization_method.algorithm = xmldsig.ALG_EXC_C14N
    signature_method = xmldsig.SignatureMethod(algorithm=xmldsig.SIG_RSA_SHA1)
    transforms = xmldsig.Transforms()
    envelope_transform = xmldsig.Transform(algorithm=xmldsig.TRANSFORM_ENVELOPED)
    c14_transform = xmldsig.Transform(algorithm=xmldsig.ALG_EXC_C14N)
    transforms.transform = [envelope_transform, c14_transform]
    digest_method = xmldsig.DigestMethod(algorithm=xmldsig.DIGEST_SHA1)
    digest_value = xmldsig.DigestValue()
    reference = xmldsig.Reference()
    reference.uri = ('#' + self.assertion_id)
    reference.digest_method = digest_method
    reference.digest_value = digest_value
    reference.transforms = transforms
    signed_info = xmldsig.SignedInfo()
    signed_info.canonicalization_method = canonicalization_method
    signed_info.signature_method = signature_method
    signed_info.reference = reference
    key_info = xmldsig.KeyInfo()
    key_info.x509_data = xmldsig.X509Data()
    signature = xmldsig.Signature()
    signature.signed_info = signed_info
    signature.signature_value = xmldsig.SignatureValue()
    signature.key_info = key_info
    return signature
