How to verify an XML signature in an iOS application?

I've been tossed into the world of XML digital signatures with an iOS project I'm working on; I need to verify the digital signature of a SAML assertion.

I've been reading a lot about validating XML signatures, and I think I get the basics about how it signs the digest with the private key and I can verify it with the public key (which should be in the included x509 certificate) so I can be certain of the SAML token's source.

I found a C libray, xmlsec, that looks like it has a lot of the code I need for verifying the signature and have been working on trying to implement that. However, I haven't been able to figure it out. From what I understand, I'm pretty sure I would have to compile the library in with my code. I've copied the source into my project, but I get errors during compile about things not being defined.

Before I spend countless hours heading down that path, I figured I would reach out to the community and see if anyone has had any experience verifying an xml digital signature and whether they could give insight on implementing that in an iOS project.

For what it's worth, here's a chunk of the SAML assertion I'm getting from the single sign-on service:



[...]

    
        
        
        
            
                
                
            
            
            zj4pCHBNMln+28Jq/v1YIScfiuw=
        
    
    [...]
    
        
            MIIDVjCCAj6gAwIBAgIGAS67wkWCMA0GCSqGSIb3[...]7bgf
        
        
            
                [...]
                AQAB
            
        
    

7
задан Perception 5 August 2011 в 15:36
поделиться