      - returns: the certificate chain for the trust
      */
     func certificateChainForTrust(trust: SecTrustRef) -> [NSData] {
-        let certificates = (0..<SecTrustGetCertificateCount(trust)).reduce([NSData]()) { (var certificates: [NSData], index: Int) -> [NSData] in
+        let certificates = (0..<SecTrustGetCertificateCount(trust)).reduce([NSData]()) { (certificates: [NSData], index: Int) -> [NSData] in
+            var certificates = certificates
             let cert = SecTrustGetCertificateAtIndex(trust, index)
             certificates.append(SecCertificateCopyData(cert!))
             return certificates

    
}

private class SSLCert {
    var certData: NSData?
    var key: SecKeyRef?
    

     
     - returns: a representation security object to be used with
     */
    public init(data: NSData) {
        self.certData = data
    }
    
