Skip to content

Commit b1a12c0

Browse files
Himanshu-Sharma-ODCHimanshu-Sharma-ODC
authored andcommitted
Added documentation for SSL pinning methods
1 parent 4443a9c commit b1a12c0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Sources/ScClient/client.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,19 @@ public class ScClient : Listener, WebSocketDelegate {
197197
socket.disableSSLCertValidation = value
198198
}
199199

200-
// uses the .cer files in your app's bundle
200+
/**
201+
Uses the .cer files in your app's bundle
202+
*/
201203
public func useSSLCertificate() {
202204
socket.security = SSLSecurity()
203205
}
204206

205-
// The usePublicKeys bool is whether to use the certificates for validation or the public keys. The public keys will be extracted from the certificates automatically if usePublicKeys is choosen.
207+
/**
208+
You load either a Data blob of your certificate or you can use a SecKeyRef if you have a public key you want to use.
209+
- Parameters:
210+
- data: Data blob of your certificate.
211+
- usePublicKeys: The usePublicKeys bool is whether to use the certificates for validation or the public keys.
212+
*/
206213
public func loadSSLCertificateFromData(data : Data, usePublicKeys : Bool = false) {
207214
socket.security = SSLSecurity(certs: [SSLCert(data: data)], usePublicKeys: usePublicKeys)
208215
}

0 commit comments

Comments
 (0)