Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Swift #14

Closed
nabla-c0d3 opened this issue Jul 1, 2015 · 3 comments
Closed

Add support for Swift #14

nabla-c0d3 opened this issue Jul 1, 2015 · 3 comments

Comments

@nabla-c0d3
Copy link
Member

No description provided.

@nabla-c0d3
Copy link
Member Author

The current version actually works fine in Swift Apps; here's sample initialization code:

    var config = [
        "yahoo.com": [
            kTSKPublicKeyAlgorithms: [kTSKAlgorithmRsa2048],
            kTSKPublicKeyHashes: [
                "JbQbUG5JMJUoI6brnx0x3vZF6jilxsapbXGVfjhN8Fg=",
                "WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="
                ],
            kTSKIncludeSubdomains: true,
            kTSKEnforcePinning: true,
            ]
        ]

    TrustKit.initializeWithConfiguration(config)

@Rahul379
Copy link

Hi
TrustKit.initializeWithConfiguration(config) is giving error. Can you help what is missing.

@ChristopherJoonMiller
Copy link

@Rahul379 the console log should explain what the problem is.

Try something like this:

        let trustKitConfig = [
            kTSKSwizzleNetworkDelegates: true,
            kTSKPinnedDomains: [
                "yahoo.com": [
                    kTSKPublicKeyAlgorithms: [kTSKAlgorithmRsa2048],
                    kTSKPublicKeyHashes: [
                        "xxxxx", // actual key
                        "yyyyy"  // need a backup here
                    ],
                    kTSKIncludeSubdomains: true,
                    kTSKEnforcePinning: true,
                ]
            ]
        ]
        TrustKit.initializeWithConfiguration(trustKitConfig)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants