Acquires a new credential using a password or certificate.


func gss_aapl_initial_cred(_ desired_name: gss_name_t, _ desired_mech: gss_const_OID, _ attributes: CFDictionary?, _ output_cred_handle: UnsafeMutablePointer<gss_cred_id_t>?, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>?) -> OM_uint32



The name to use to acquire the credential. Import the name using gss_import_name(_:_:_:_:). Ensure that the mechanism specified by the desired_mech parameter supports the name type.


The mechanism to use to acquire the credential, for example GSS_KRB5_MECHANISM or GSS_NTLM_MECHANISM. Use gss_indicate_mechs(_:_:) to get a complete list of supported mechanisms.


A dictionary that includes either the key kGSSICPassword to specify a password or kGSSICCertificate to name a certificate for use in acquiring the credential. It may also contain any of the other keys listed in Initial Credential Keys to optionally condition the operation.


A credential pointer that the function sets to point at the new credential on success, or sets to GSS_C_NO_CREDENTIAL on failure. Use gss_release_cred(_:_:) or gss_destroy_cred(_:_:) to release the credential's memory when you are done with it.


An error pointer that the function sets to point at a new error object if the function call fails. Pass NULL to ignore this error. When an error does exist, it describes the reason for the failure, and you are responsible for releasing it with CFRelease.

Return Value

A status code set to GSS_S_COMPLETE if the call succeeds, or some other value indicating the reason for failure if not.


Don't call this function on a UI update thread because it may block on network activity.