   signature = xmlcrypto.xpath(doc, "/*/*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']")[0]
   sig = new xmlcrypto.SignedXml()
   sig.keyInfoProvider = getKey: -> certificate
-  sig.loadSignature(signature.toString())
+  sig.loadSignature signature.toString()
   return cb null if sig.checkSignature(xml)
   cb new Error("SAML Assertion signature check failed!")
 

zlib          = require 'zlib'


create_authn_request = (issuer, destination) ->
  xmlbuilder.create
    AuthnRequest:
      '@xmlns': 'urn:oasis:names:tc:SAML:2.0:protocol'

      '@ID': '_e23de96fdd91332b229368086adb655139e24ac6e2'
      '@IssueInstant': (new Date()).toISOString()
      '@Destination': destination
      '@AssertionConsumerServiceURL': assert_endpoint
      '@ProtocolBinding': 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'
      'saml:Issuer': "https://saml.not.clever.com/metadata.xml"
      NameIDPolicy:
