Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSURLCredentialMBS class.

NSURLCredentialMBS.credential(User as string, password as string, persistence as Integer = 0) as NSURLCredentialMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Networking MBS MacBase Plugin 13.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Create a new NSURLCredential with a user and password.
Example
dim u as NSURLCredentialMBS
dim p as Integer = NSURLCredentialMBS.NSURLCredentialPersistenceForSession

u = NSURLCredentialMBS.credential("Christian", "teddy123", p)

MsgBox u.user+EndOfLine+u.password+EndOfLine+str(u.persistence)

user: the username
password: the password
persistence: Integer that says to store per session, permanently or not at all.
Can be NSURLCredentialPersistenceForSession, NSURLCredentialPersistenceNone or NSURLCredentialPersistencePermanent.

NSURLCredentialMBS.credentialWithPEM(Data as MemoryBlock, Password as String = "") as NSURLCredentialMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Networking MBS MacBase Plugin 20.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates an identity credentials with certificate and private key in PEM file.

Password is optional.
This is a convenience function using SecItemImport to read data and then builds the result with credentialWithIdentity function.
Returns nil for any error.

NSURLCredentialMBS.credentialWithPKCS12(Data as MemoryBlock, Password as String = "") as NSURLCredentialMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Networking MBS MacBase Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates an identity credentials with certificate and private key in PKCS#12 file.

Password is optional.
This is a convenience function using SecPKCS12Import to read data and then builds the result with credentialWithIdentity function.
Returns nil for any error.

NSURLCredentialMBS.credentialWithTrustingServer(ProtectionSpace as NSURLProtectionSpaceMBS) as NSURLCredentialMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Networking MBS MacBase Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a credential trusting the server in the protection space.

This is a convenience function using the ServerTrust in the protection space to wrap it in a new to read data and then builds the result with credential object with credentialForTrust function.
Returns nil for any error.

The items on this page are in the following plugins: MBS MacBase Plugin.


The biggest plugin in space...