Documentation Archive Developer
Search

SecurityFoundation Changes for Swift

SecurityFoundation

Declaration
From
class SFAuthorization : NSObject, NSCoding {
    class func authorization() -> AnyObject!
    func authorizationRef() -> AuthorizationRef
    class func authorizationWithFlags(_ flags: AuthorizationFlags, rights rights: UnsafePointer<AuthorizationRights>, environment environment: UnsafePointer<AuthorizationEnvironment>) -> AnyObject!
    init!(flags flags: AuthorizationFlags, rights rights: UnsafePointer<AuthorizationRights>, environment environment: UnsafePointer<AuthorizationEnvironment>)
    init!()
    func invalidateCredentials()
    func obtainWithRight(_ rightName: AuthorizationString, flags flags: AuthorizationFlags, error error: NSErrorPointer) -> Bool
    func obtainWithRights(_ rights: UnsafePointer<AuthorizationRights>, flags flags: AuthorizationFlags, environment environment: UnsafePointer<AuthorizationEnvironment>, authorizedRights authorizedRights: UnsafeMutablePointer<UnsafeMutablePointer<AuthorizationRights>>, error error: NSErrorPointer) -> Bool
}
extension SFAuthorization {
    func permitWithRights(_ rights: UnsafePointer<AuthorizationRights>, flags flags: AuthorizationFlags, environment environment: UnsafePointer<AuthorizationEnvironment>, authorizedRights authorizedRights: UnsafeMutablePointer<AuthorizationRights>) -> OSStatus
    func permitWithRight(_ rightName: AuthorizationString, flags flags: AuthorizationFlags) -> OSStatus
}
To
class SFAuthorization : NSObject, NSCoding {
    class func authorization() -> AnyObject!
    func authorizationRef() -> AuthorizationRef
    class func authorizationWithFlags(_ flags: AuthorizationFlags, rights rights: UnsafePointer<AuthorizationRights>, environment environment: UnsafePointer<AuthorizationEnvironment>) -> AnyObject!
    init!(flags flags: AuthorizationFlags, rights rights: UnsafePointer<AuthorizationRights>, environment environment: UnsafePointer<AuthorizationEnvironment>)
    init!()
    func invalidateCredentials()
    func obtainWithRight(_ rightName: AuthorizationString, flags flags: AuthorizationFlags) throws
    func obtainWithRights(_ rights: UnsafePointer<AuthorizationRights>, flags flags: AuthorizationFlags, environment environment: UnsafePointer<AuthorizationEnvironment>, authorizedRights authorizedRights: UnsafeMutablePointer<UnsafeMutablePointer<AuthorizationRights>>) throws
}
extension SFAuthorization {
    func permitWithRights(_ rights: UnsafePointer<AuthorizationRights>, flags flags: AuthorizationFlags, environment environment: UnsafePointer<AuthorizationEnvironment>, authorizedRights authorizedRights: UnsafeMutablePointer<AuthorizationRights>) -> OSStatus
    func permitWithRight(_ rightName: AuthorizationString, flags flags: AuthorizationFlags) -> OSStatus
}

Declaration
From
func obtainWithRight(_ rightName: AuthorizationString, flags flags: AuthorizationFlags, error error: NSErrorPointer) -> Bool
To
func obtainWithRight(_ rightName: AuthorizationString, flags flags: AuthorizationFlags) throws

Declaration
From
func obtainWithRights(_ rights: UnsafePointer<AuthorizationRights>, flags flags: AuthorizationFlags, environment environment: UnsafePointer<AuthorizationEnvironment>, authorizedRights authorizedRights: UnsafeMutablePointer<UnsafeMutablePointer<AuthorizationRights>>, error error: NSErrorPointer) -> Bool
To
func obtainWithRights(_ rights: UnsafePointer<AuthorizationRights>, flags flags: AuthorizationFlags, environment environment: UnsafePointer<AuthorizationEnvironment>, authorizedRights authorizedRights: UnsafeMutablePointer<UnsafeMutablePointer<AuthorizationRights>>) throws