SSL Pinning – GBG IDscan Documentation

SSL Pinning

If you would like to use SSL public key pinning, you can provide a set of Data object of your SSL certificates that you would like to check against. We will only assess public keys of your certificate, hence if it expires it won’t affect the communication. 

Swift

// Create credentials object
 let credentials = IDSEnterpriseCredentials(token: "token", urlPrefix: "URL")
 // Get your cert data
 let certData = try! Data(contentsOf: Bundle.main.url(forResource: "cloud", withExtension: "cer")!)
 // Set the pinning
 credentials.pinningCertificates = Set(arrayLiteral: certData)

Was this page helpful?