Returns a signed version of the invoice.
        @param private:file Private key file-like object
        @param public:file Public key file-like object
        @param passphrase:str Private key passphrase if any.
        @return: str

def to_signed_str(self, private, public, passphrase=None):
        '''
        Returns a signed version of the invoice.
        @param private:file Private key file-like object
        @param public:file Public key file-like object
        @param passphrase:str Private key passphrase if any.
        @return: str
        '''
        from pyxmli import xmldsig
        try:
            from Crypto.PublicKey import RSA
        except ImportError:
            raise ImportError('PyCrypto 2.5 or more recent module is ' \
                              'required to enable XMLi signing.\n' \
                              'Please visit: http://pycrypto.sourceforge.net/')
            
        if not isinstance(private, RSA._RSAobj):
            private = RSA.importKey(private.read(), passphrase=passphrase)
        
        if not isinstance(public, RSA._RSAobj):
            public = RSA.importKey(public.read())
            
        return to_unicode(xmldsig.sign(to_unicode(self.to_string()),
                                       private, public))