0001    //
0002    //  Keychain.swift
0003    //  KeychainAccess
0004    //
0005    //  Created by kishikawa katsumi on 2014/12/24.
0006    //  Copyright (c) 2014 kishikawa katsumi. All rights reserved.
0007    //
0008    
0009    import Foundation
0010    import Security
0011    
0012    public let KeychainAccessErrorDomain
Keychain.swift:992
        let error = NSError(domain: KeychainAccessErrorDomain, code: Int(Status.ConversionError.rawValue), userInfo: [NSLocalizedDescriptionKey: message])
Keychain.swift:1005
        let error = NSError(domain: KeychainAccessErrorDomain, code: Int(status), userInfo: [NSLocalizedDescriptionKey: message])
Keychain.swift:1201
                    return (attributes, NSError(domain: KeychainAccessErrorDomain, code: Int(Status.UnexpectedError.rawValue), userInfo: [NSLocalizedDescriptionKey: message]))
= "com.kishikawakatsumi.KeychainAccess.error" 0013 0014 public enum ItemClass
Keychain.swift:315
    public var itemClass: ItemClass {
Keychain.swift:702
    public class func allKeys(itemClass: ItemClass) -> [(String, String)] {
Keychain.swift:737
    public class func allItems(itemClass: ItemClass) -> [[String: AnyObject]] {
Keychain.swift:934
    private class func prettify(itemClass itemClass: ItemClass, items: [[String: AnyObject]]) -> [[String: AnyObject]] {
Keychain.swift:1017
    var itemClass: ItemClass = .GenericPassword
Keychain.swift:1229
extension ItemClass : RawRepresentable, CustomStringConvertible {
Keychain.swift:1234
            self = GenericPassword
Keychain.swift:1236
            self = InternetPassword
{ 0015 case GenericPassword
Keychain.swift:717
                    case .GenericPassword:
Keychain.swift:941
            case .GenericPassword:
Keychain.swift:1017
    var itemClass: ItemClass = .GenericPassword
Keychain.swift:1150
        case .GenericPassword:
Keychain.swift:1234
            self = GenericPassword
Keychain.swift:1244
        case GenericPassword:
Keychain.swift:1253
        case GenericPassword:
0016 case InternetPassword
Keychain.swift:407
        options.itemClass = .InternetPassword
Keychain.swift:719
                    case .InternetPassword:
Keychain.swift:948
            case .InternetPassword:
Keychain.swift:1158
        case .InternetPassword:
Keychain.swift:1236
            self = InternetPassword
Keychain.swift:1246
        case InternetPassword:
Keychain.swift:1255
        case InternetPassword:
0017 } 0018 0019 public enum ProtocolType
Keychain.swift:331
    public var protocolType: ProtocolType {
Keychain.swift:401
    public convenience init(server: String, protocolType: ProtocolType, authenticationType: AuthenticationType = .Default) {
Keychain.swift:405
    public convenience init(server: NSURL, protocolType: ProtocolType, authenticationType: AuthenticationType = .Default) {
Keychain.swift:953
                    if let protocolType = ProtocolType(rawValue: proto) {
Keychain.swift:1023
    var protocolType: ProtocolType!
Keychain.swift:1261
extension ProtocolType : RawRepresentable, CustomStringConvertible {
Keychain.swift:1266
            self = FTP
Keychain.swift:1268
            self = FTPAccount
Keychain.swift:1270
            self = HTTP
Keychain.swift:1272
            self = IRC
Keychain.swift:1274
            self = NNTP
Keychain.swift:1276
            self = POP3
Keychain.swift:1278
            self = SMTP
Keychain.swift:1280
            self = SOCKS
Keychain.swift:1282
            self = IMAP
Keychain.swift:1284
            self = LDAP
Keychain.swift:1286
            self = AppleTalk
Keychain.swift:1288
            self = AFP
Keychain.swift:1290
            self = Telnet
Keychain.swift:1292
            self = SSH
Keychain.swift:1294
            self = FTPS
Keychain.swift:1296
            self = HTTPS
Keychain.swift:1298
            self = HTTPProxy
Keychain.swift:1300
            self = HTTPSProxy
Keychain.swift:1302
            self = FTPProxy
Keychain.swift:1304
            self = SMB
Keychain.swift:1306
            self = RTSP
Keychain.swift:1308
            self = RTSPProxy
Keychain.swift:1310
            self = DAAP
Keychain.swift:1312
            self = EPPC
Keychain.swift:1314
            self = IPP
Keychain.swift:1316
            self = NNTPS
Keychain.swift:1318
            self = LDAPS
Keychain.swift:1320
            self = TelnetS
Keychain.swift:1322
            self = IMAPS
Keychain.swift:1324
            self = IRCS
Keychain.swift:1326
            self = POP3S
{ 0020 case FTP
Keychain.swift:1266
            self = FTP
Keychain.swift:1334
        case FTP:
Keychain.swift:1401
        case FTP:
0021 case FTPAccount
Keychain.swift:1268
            self = FTPAccount
Keychain.swift:1336
        case FTPAccount:
Keychain.swift:1403
        case FTPAccount:
0022 case HTTP
Keychain.swift:1270
            self = HTTP
Keychain.swift:1338
        case HTTP:
Keychain.swift:1405
        case HTTP:
0023 case IRC
Keychain.swift:1272
            self = IRC
Keychain.swift:1340
        case IRC:
Keychain.swift:1407
        case IRC:
0024 case NNTP
Keychain.swift:1274
            self = NNTP
Keychain.swift:1342
        case NNTP:
Keychain.swift:1409
        case NNTP:
0025 case POP3
Keychain.swift:1276
            self = POP3
Keychain.swift:1344
        case POP3:
Keychain.swift:1411
        case POP3:
0026 case SMTP
Keychain.swift:1278
            self = SMTP
Keychain.swift:1346
        case SMTP:
Keychain.swift:1413
        case SMTP:
0027 case SOCKS
Keychain.swift:1280
            self = SOCKS
Keychain.swift:1348
        case SOCKS:
Keychain.swift:1415
        case SOCKS:
0028 case IMAP
Keychain.swift:1282
            self = IMAP
Keychain.swift:1350
        case IMAP:
Keychain.swift:1417
        case IMAP:
0029 case LDAP
Keychain.swift:1284
            self = LDAP
Keychain.swift:1352
        case LDAP:
Keychain.swift:1419
        case LDAP:
0030 case AppleTalk
Keychain.swift:1286
            self = AppleTalk
Keychain.swift:1354
        case AppleTalk:
Keychain.swift:1421
        case AppleTalk:
0031 case AFP
Keychain.swift:1288
            self = AFP
Keychain.swift:1356
        case AFP:
Keychain.swift:1423
        case AFP:
0032 case Telnet
Keychain.swift:1290
            self = Telnet
Keychain.swift:1358
        case Telnet:
Keychain.swift:1425
        case Telnet:
0033 case SSH
Keychain.swift:1292
            self = SSH
Keychain.swift:1360
        case SSH:
Keychain.swift:1427
        case SSH:
0034 case FTPS
Keychain.swift:1294
            self = FTPS
Keychain.swift:1362
        case FTPS:
Keychain.swift:1429
        case FTPS:
0035 case HTTPS
Keychain.swift:1296
            self = HTTPS
Keychain.swift:1364
        case HTTPS:
Keychain.swift:1431
        case HTTPS:
0036 case HTTPProxy
Keychain.swift:1298
            self = HTTPProxy
Keychain.swift:1366
        case HTTPProxy:
Keychain.swift:1433
        case HTTPProxy:
0037 case HTTPSProxy
Keychain.swift:1300
            self = HTTPSProxy
Keychain.swift:1368
        case HTTPSProxy:
Keychain.swift:1435
        case HTTPSProxy:
0038 case FTPProxy
Keychain.swift:1302
            self = FTPProxy
Keychain.swift:1370
        case FTPProxy:
Keychain.swift:1437
        case FTPProxy:
0039 case SMB
Keychain.swift:1304
            self = SMB
Keychain.swift:1372
        case SMB:
Keychain.swift:1439
        case SMB:
0040 case RTSP
Keychain.swift:1306
            self = RTSP
Keychain.swift:1374
        case RTSP:
Keychain.swift:1441
        case RTSP:
0041 case RTSPProxy
Keychain.swift:1308
            self = RTSPProxy
Keychain.swift:1376
        case RTSPProxy:
Keychain.swift:1443
        case RTSPProxy:
0042 case DAAP
Keychain.swift:1310
            self = DAAP
Keychain.swift:1378
        case DAAP:
Keychain.swift:1445
        case DAAP:
0043 case EPPC
Keychain.swift:1312
            self = EPPC
Keychain.swift:1380
        case EPPC:
Keychain.swift:1447
        case EPPC:
0044 case IPP
Keychain.swift:1314
            self = IPP
Keychain.swift:1382
        case IPP:
Keychain.swift:1449
        case IPP:
0045 case NNTPS
Keychain.swift:1316
            self = NNTPS
Keychain.swift:1384
        case NNTPS:
Keychain.swift:1451
        case NNTPS:
0046 case LDAPS
Keychain.swift:1318
            self = LDAPS
Keychain.swift:1386
        case LDAPS:
Keychain.swift:1453
        case LDAPS:
0047 case TelnetS
Keychain.swift:1320
            self = TelnetS
Keychain.swift:1388
        case TelnetS:
Keychain.swift:1455
        case TelnetS:
0048 case IMAPS
Keychain.swift:1322
            self = IMAPS
Keychain.swift:1390
        case IMAPS:
Keychain.swift:1457
        case IMAPS:
0049 case IRCS
Keychain.swift:1324
            self = IRCS
Keychain.swift:1392
        case IRCS:
Keychain.swift:1459
        case IRCS:
0050 case POP3S
Keychain.swift:1326
            self = POP3S
Keychain.swift:1394
        case POP3S:
Keychain.swift:1461
        case POP3S:
0051 } 0052 0053 public enum AuthenticationType
Keychain.swift:335
    public var authenticationType: AuthenticationType {
Keychain.swift:401
    public convenience init(server: String, protocolType: ProtocolType, authenticationType: AuthenticationType = .Default) {
Keychain.swift:405
    public convenience init(server: NSURL, protocolType: ProtocolType, authenticationType: AuthenticationType = .Default) {
Keychain.swift:958
                    if let authenticationType = AuthenticationType(rawValue: auth) {
Keychain.swift:1024
    var authenticationType: AuthenticationType = .Default
Keychain.swift:1467
extension AuthenticationType : RawRepresentable, CustomStringConvertible {
Keychain.swift:1472
            self = NTLM
Keychain.swift:1474
            self = MSN
Keychain.swift:1476
            self = DPA
Keychain.swift:1478
            self = RPA
Keychain.swift:1480
            self = HTTPBasic
Keychain.swift:1482
            self = HTTPDigest
Keychain.swift:1484
            self = HTMLForm
Keychain.swift:1486
            self = Default
{ 0054 case NTLM
Keychain.swift:1472
            self = NTLM
Keychain.swift:1494
        case NTLM:
Keychain.swift:1515
        case NTLM:
0055 case MSN
Keychain.swift:1474
            self = MSN
Keychain.swift:1496
        case MSN:
Keychain.swift:1517
        case MSN:
0056 case DPA
Keychain.swift:1476
            self = DPA
Keychain.swift:1498
        case DPA:
Keychain.swift:1519
        case DPA:
0057 case RPA
Keychain.swift:1478
            self = RPA
Keychain.swift:1500
        case RPA:
Keychain.swift:1521
        case RPA:
0058 case HTTPBasic
Keychain.swift:1480
            self = HTTPBasic
Keychain.swift:1502
        case HTTPBasic:
Keychain.swift:1523
        case HTTPBasic:
0059 case HTTPDigest
Keychain.swift:1482
            self = HTTPDigest
Keychain.swift:1504
        case HTTPDigest:
Keychain.swift:1525
        case HTTPDigest:
0060 case HTMLForm
Keychain.swift:1484
            self = HTMLForm
Keychain.swift:1506
        case HTMLForm:
Keychain.swift:1527
        case HTMLForm:
0061 case Default
Keychain.swift:401
    public convenience init(server: String, protocolType: ProtocolType, authenticationType: AuthenticationType = .Default) {
Keychain.swift:405
    public convenience init(server: NSURL, protocolType: ProtocolType, authenticationType: AuthenticationType = .Default) {
Keychain.swift:1024
    var authenticationType: AuthenticationType = .Default
Keychain.swift:1486
            self = Default
Keychain.swift:1508
        case Default:
Keychain.swift:1529
        case Default:
0062 } 0063 0064 public enum Accessibility
Keychain.swift:339
    public var accessibility: Accessibility {
Keychain.swift:420
    public func accessibility(accessibility: Accessibility) -> Keychain {
Keychain.swift:428
    public func accessibility(accessibility: Accessibility, authenticationPolicy: AuthenticationPolicy) -> Keychain {
Keychain.swift:976
                if let accessibility = Accessibility(rawValue: accessible) {
Keychain.swift:1026
    var accessibility: Accessibility = .AfterFirstUnlock
Keychain.swift:1535
extension Accessibility : RawRepresentable, CustomStringConvertible {
Keychain.swift:1541
                self = WhenUnlocked
Keychain.swift:1543
                self = AfterFirstUnlock
Keychain.swift:1545
                self = Always
Keychain.swift:1547
                self = WhenPasscodeSetThisDeviceOnly
Keychain.swift:1549
                self = WhenUnlockedThisDeviceOnly
Keychain.swift:1551
                self = AfterFirstUnlockThisDeviceOnly
Keychain.swift:1553
                self = AlwaysThisDeviceOnly
Keychain.swift:1560
                self = WhenUnlocked
Keychain.swift:1562
                self = AfterFirstUnlock
Keychain.swift:1564
                self = Always
Keychain.swift:1566
                self = WhenUnlockedThisDeviceOnly
Keychain.swift:1568
                self = AfterFirstUnlockThisDeviceOnly
Keychain.swift:1570
                self = AlwaysThisDeviceOnly
{ 0065 /** 0066 Item data can only be accessed 0067 while the device is unlocked. This is recommended for items that only 0068 need be accesible while the application is in the foreground. Items 0069 with this attribute will migrate to a new device when using encrypted 0070 backups. 0071 */ 0072 case WhenUnlocked
Keychain.swift:1541
                self = WhenUnlocked
Keychain.swift:1560
                self = WhenUnlocked
Keychain.swift:1579
        case WhenUnlocked:
Keychain.swift:1602
        case WhenUnlocked:
0073 0074 /** 0075 Item data can only be 0076 accessed once the device has been unlocked after a restart. This is 0077 recommended for items that need to be accesible by background 0078 applications. Items with this attribute will migrate to a new device 0079 when using encrypted backups. 0080 */ 0081 case AfterFirstUnlock
Keychain.swift:1026
    var accessibility: Accessibility = .AfterFirstUnlock
Keychain.swift:1543
                self = AfterFirstUnlock
Keychain.swift:1562
                self = AfterFirstUnlock
Keychain.swift:1581
        case AfterFirstUnlock:
Keychain.swift:1604
        case AfterFirstUnlock:
0082 0083 /** 0084 Item data can always be accessed 0085 regardless of the lock state of the device. This is not recommended 0086 for anything except system use. Items with this attribute will migrate 0087 to a new device when using encrypted backups. 0088 */ 0089 case Always
Keychain.swift:1545
                self = Always
Keychain.swift:1564
                self = Always
Keychain.swift:1583
        case Always:
Keychain.swift:1606
        case Always:
0090 0091 /** 0092 Item data can 0093 only be accessed while the device is unlocked. This class is only 0094 available if a passcode is set on the device. This is recommended for 0095 items that only need to be accessible while the application is in the 0096 foreground. Items with this attribute will never migrate to a new 0097 device, so after a backup is restored to a new device, these items 0098 will be missing. No items can be stored in this class on devices 0099 without a passcode. Disabling the device passcode will cause all 0100 items in this class to be deleted. 0101 */ 0102 @available(iOS 8.0, OSX 10.10, *) 0103 case WhenPasscodeSetThisDeviceOnly
Keychain.swift:1547
                self = WhenPasscodeSetThisDeviceOnly
Keychain.swift:1585
        case WhenPasscodeSetThisDeviceOnly:
Keychain.swift:1608
        case WhenPasscodeSetThisDeviceOnly:
0104 0105 /** 0106 Item data can only 0107 be accessed while the device is unlocked. This is recommended for items 0108 that only need be accesible while the application is in the foreground. 0109 Items with this attribute will never migrate to a new device, so after 0110 a backup is restored to a new device, these items will be missing. 0111 */ 0112 case WhenUnlockedThisDeviceOnly
Keychain.swift:1549
                self = WhenUnlockedThisDeviceOnly
Keychain.swift:1566
                self = WhenUnlockedThisDeviceOnly
Keychain.swift:1591
        case WhenUnlockedThisDeviceOnly:
Keychain.swift:1610
        case WhenUnlockedThisDeviceOnly:
0113 0114 /** 0115 Item data can 0116 only be accessed once the device has been unlocked after a restart. 0117 This is recommended for items that need to be accessible by background 0118 applications. Items with this attribute will never migrate to a new 0119 device, so after a backup is restored to a new device these items will 0120 be missing. 0121 */ 0122 case AfterFirstUnlockThisDeviceOnly
Keychain.swift:1551
                self = AfterFirstUnlockThisDeviceOnly
Keychain.swift:1568
                self = AfterFirstUnlockThisDeviceOnly
Keychain.swift:1593
        case AfterFirstUnlockThisDeviceOnly:
Keychain.swift:1612
        case AfterFirstUnlockThisDeviceOnly:
0123 0124 /** 0125 Item data can always 0126 be accessed regardless of the lock state of the device. This option 0127 is not recommended for anything except system use. Items with this 0128 attribute will never migrate to a new device, so after a backup is 0129 restored to a new device, these items will be missing. 0130 */ 0131 case AlwaysThisDeviceOnly
Keychain.swift:1553
                self = AlwaysThisDeviceOnly
Keychain.swift:1570
                self = AlwaysThisDeviceOnly
Keychain.swift:1595
        case AlwaysThisDeviceOnly:
Keychain.swift:1614
        case AlwaysThisDeviceOnly:
0132 } 0133 0134 public struct AuthenticationPolicy
Keychain.swift:142
    public static let UserPresence = AuthenticationPolicy(rawValue: 1 << 0)
Keychain.swift:152
    public static let TouchIDAny = AuthenticationPolicy(rawValue: 1 << 1)
Keychain.swift:162
    public static let TouchIDCurrentSet = AuthenticationPolicy(rawValue: 1 << 3)
Keychain.swift:169
    public static let DevicePasscode = AuthenticationPolicy(rawValue: 1 << 4)
Keychain.swift:178
    public static let Or = AuthenticationPolicy(rawValue: 1 << 14)
Keychain.swift:187
    public static let And = AuthenticationPolicy(rawValue: 1 << 15)
Keychain.swift:195
    public static let PrivateKeyUsage = AuthenticationPolicy(rawValue: 1 << 30)
Keychain.swift:204
    public static let ApplicationPassword = AuthenticationPolicy(rawValue: 1 << 31)
Keychain.swift:345
    public var authenticationPolicy: AuthenticationPolicy? {
Keychain.swift:428
    public func accessibility(accessibility: Accessibility, authenticationPolicy: AuthenticationPolicy) -> Keychain {
Keychain.swift:1027
    var authenticationPolicy: AuthenticationPolicy?
: OptionSetType { 0135 /** 0136 User presence policy using Touch ID or Passcode. Touch ID does not 0137 have to be available or enrolled. Item is still accessible by Touch ID 0138 even if fingers are added or removed. 0139 */ 0140 @available(iOS 8.0, OSX 10.10, *) 0141 @available(watchOS, unavailable) 0142 public static let UserPresence = AuthenticationPolicy(rawValue: 1 << 0) 0143 0144 /** 0145 Constraint: Touch ID (any finger). Touch ID must be available and 0146 at least one finger must be enrolled. Item is still accessible by 0147 Touch ID even if fingers are added or removed. 0148 */ 0149 @available(iOS 9.0, *) 0150 @available(OSX, unavailable) 0151 @available(watchOS, unavailable) 0152 public static let TouchIDAny = AuthenticationPolicy(rawValue: 1 << 1) 0153 0154 /** 0155 Constraint: Touch ID from the set of currently enrolled fingers. 0156 Touch ID must be available and at least one finger must be enrolled. 0157 When fingers are added or removed, the item is invalidated. 0158 */ 0159 @available(iOS 9.0, *) 0160 @available(OSX, unavailable) 0161 @available(watchOS, unavailable) 0162 public static let TouchIDCurrentSet = AuthenticationPolicy(rawValue: 1 << 3) 0163 0164 /** 0165 Constraint: Device passcode 0166 */ 0167 @available(iOS 9.0, OSX 10.11, *) 0168 @available(watchOS, unavailable) 0169 public static let DevicePasscode = AuthenticationPolicy(rawValue: 1 << 4) 0170 0171 /** 0172 Constraint logic operation: when using more than one constraint, 0173 at least one of them must be satisfied. 0174 */ 0175 @available(iOS 9.0, *) 0176 @available(OSX, unavailable) 0177 @available(watchOS, unavailable) 0178 public static let Or = AuthenticationPolicy(rawValue: 1 << 14) 0179 0180 /** 0181 Constraint logic operation: when using more than one constraint, 0182 all must be satisfied. 0183 */ 0184 @available(iOS 9.0, *) 0185 @available(OSX, unavailable) 0186 @available(watchOS, unavailable) 0187 public static let And = AuthenticationPolicy(rawValue: 1 << 15) 0188 0189 /** 0190 Create access control for private key operations (i.e. sign operation) 0191 */ 0192 @available(iOS 9.0, *) 0193 @available(OSX, unavailable) 0194 @available(watchOS, unavailable) 0195 public static let PrivateKeyUsage = AuthenticationPolicy(rawValue: 1 << 30) 0196 0197 /** 0198 Security: Application provided password for data encryption key generation. 0199 This is not a constraint but additional item encryption mechanism. 0200 */ 0201 @available(iOS 9.0, *) 0202 @available(OSX, unavailable) 0203 @available(watchOS, unavailable) 0204 public static let ApplicationPassword = AuthenticationPolicy(rawValue: 1 << 31) 0205 0206 public let rawValue
Keychain.swift:209
        self.rawValue = rawValue
Keychain.swift:1196
                guard let accessControl = SecAccessControlCreateWithFlags(kCFAllocatorDefault, accessibility.rawValue, SecAccessControlCreateFlags(rawValue: policy.rawValue), &error) else {
: Int 0207 0208 public init
Keychain.swift:142
    public static let UserPresence = AuthenticationPolicy(rawValue: 1 << 0)
Keychain.swift:152
    public static let TouchIDAny = AuthenticationPolicy(rawValue: 1 << 1)
Keychain.swift:162
    public static let TouchIDCurrentSet = AuthenticationPolicy(rawValue: 1 << 3)
Keychain.swift:169
    public static let DevicePasscode = AuthenticationPolicy(rawValue: 1 << 4)
Keychain.swift:178
    public static let Or = AuthenticationPolicy(rawValue: 1 << 14)
Keychain.swift:187
    public static let And = AuthenticationPolicy(rawValue: 1 << 15)
Keychain.swift:195
    public static let PrivateKeyUsage = AuthenticationPolicy(rawValue: 1 << 30)
Keychain.swift:204
    public static let ApplicationPassword = AuthenticationPolicy(rawValue: 1 << 31)
(rawValue:Int) { 0209 self.rawValue = rawValue 0210 } 0211 } 0212 0213 public struct Attributes
Keychain.swift:507
    public func get<T>(key: String, @noescape handler: Attributes? -> T) throws -> T {
Keychain.swift:527
            return handler(Attributes(attributes: attributes))
Keychain.swift:1219
extension Attributes : CustomStringConvertible, CustomDebugStringConvertible {
{ 0214 public var `class`: String? { 0215 return attributes[Class] as? String 0216 } 0217 public var data: NSData? { 0218 return attributes[ValueData] as? NSData 0219 } 0220 public var ref: NSData? { 0221 return attributes[ValueRef] as? NSData 0222 } 0223 public var persistentRef: NSData? { 0224 return attributes[ValuePersistentRef] as? NSData 0225 } 0226 0227 public var accessible: String? { 0228 return attributes[AttributeAccessible] as? String 0229 } 0230 public var accessControl: SecAccessControl? { 0231 if #available(OSX 10.10, *) { 0232 if let accessControl = attributes[AttributeAccessControl] { 0233 return (accessControl as! SecAccessControl) 0234 } 0235 return nil 0236 } else { 0237 return nil 0238 } 0239 } 0240 public var accessGroup: String? { 0241 return attributes[AttributeAccessGroup] as? String 0242 } 0243 public var synchronizable: Bool? { 0244 return attributes[AttributeSynchronizable] as? Bool 0245 } 0246 public var creationDate: NSDate? { 0247 return attributes[AttributeCreationDate] as? NSDate 0248 } 0249 public var modificationDate: NSDate? { 0250 return attributes[AttributeModificationDate] as? NSDate 0251 } 0252 public var attributeDescription: String? { 0253 return attributes[AttributeDescription] as? String 0254 } 0255 public var comment: String? { 0256 return attributes[AttributeComment] as? String 0257 } 0258 public var creator: String? { 0259 return attributes[AttributeCreator] as? String 0260 } 0261 public var type: String? { 0262 return attributes[AttributeType] as? String 0263 } 0264 public var label: String? { 0265 return attributes[AttributeLabel] as? String 0266 } 0267 public var isInvisible: Bool? { 0268 return attributes[AttributeIsInvisible] as? Bool 0269 } 0270 public var isNegative: Bool? { 0271 return attributes[AttributeIsNegative] as? Bool 0272 } 0273 public var account: String? { 0274 return attributes[AttributeAccount] as? String 0275 } 0276 public var service: String? { 0277 return attributes[AttributeService] as? String 0278 } 0279 public var generic: NSData? { 0280 return attributes[AttributeGeneric] as? NSData 0281 } 0282 public var securityDomain: String? { 0283 return attributes[AttributeSecurityDomain] as? String 0284 } 0285 public var server: String? { 0286 return attributes[AttributeServer] as? String 0287 } 0288 public var `protocol`: String? { 0289 return attributes[AttributeProtocol] as? String 0290 } 0291 public var authenticationType: String? { 0292 return attributes[AttributeAuthenticationType] as? String 0293 } 0294 public var port: Int? { 0295 return attributes[AttributePort] as? Int 0296 } 0297 public var path: String? { 0298 return attributes[AttributePath] as? String 0299 } 0300 0301 private let attributes
Keychain.swift:215
        return attributes[Class] as? String
Keychain.swift:218
        return attributes[ValueData] as? NSData
Keychain.swift:221
        return attributes[ValueRef] as? NSData
Keychain.swift:224
        return attributes[ValuePersistentRef] as? NSData
Keychain.swift:228
        return attributes[AttributeAccessible] as? String
Keychain.swift:232
            if let accessControl = attributes[AttributeAccessControl] {
Keychain.swift:241
        return attributes[AttributeAccessGroup] as? String
Keychain.swift:244
        return attributes[AttributeSynchronizable] as? Bool
Keychain.swift:247
        return attributes[AttributeCreationDate] as? NSDate
Keychain.swift:250
        return attributes[AttributeModificationDate] as? NSDate
Keychain.swift:253
        return attributes[AttributeDescription] as? String
Keychain.swift:256
        return attributes[AttributeComment] as? String
Keychain.swift:259
        return attributes[AttributeCreator] as? String
Keychain.swift:262
        return attributes[AttributeType] as? String
Keychain.swift:265
        return attributes[AttributeLabel] as? String
Keychain.swift:268
        return attributes[AttributeIsInvisible] as? Bool
Keychain.swift:271
        return attributes[AttributeIsNegative] as? Bool
Keychain.swift:274
        return attributes[AttributeAccount] as? String
Keychain.swift:277
        return attributes[AttributeService] as? String
Keychain.swift:280
        return attributes[AttributeGeneric] as? NSData
Keychain.swift:283
        return attributes[AttributeSecurityDomain] as? String
Keychain.swift:286
        return attributes[AttributeServer] as? String
Keychain.swift:289
        return attributes[AttributeProtocol] as? String
Keychain.swift:292
        return attributes[AttributeAuthenticationType] as? String
Keychain.swift:295
        return attributes[AttributePort] as? Int
Keychain.swift:298
        return attributes[AttributePath] as? String
Keychain.swift:304
        self.attributes = attributes
Keychain.swift:309
            return attributes[key]
Keychain.swift:1221
        return "\(attributes)"
: [String: AnyObject] 0302 0303 init
Keychain.swift:527
            return handler(Attributes(attributes: attributes))
(attributes: [String: AnyObject]) { 0304 self.attributes = attributes 0305 } 0306 0307 public subscript(key: String) -> AnyObject? { 0308 get { 0309 return attributes[key] 0310 } 0311 } 0312 } 0313 0314 public class Keychain
Keychain.swift:420
    public func accessibility(accessibility: Accessibility) -> Keychain {
Keychain.swift:423
        return Keychain(options)
Keychain.swift:428
    public func accessibility(accessibility: Accessibility, authenticationPolicy: AuthenticationPolicy) -> Keychain {
Keychain.swift:432
        return Keychain(options)
Keychain.swift:435
    public func synchronizable(synchronizable: Bool) -> Keychain {
Keychain.swift:438
        return Keychain(options)
Keychain.swift:441
    public func label(label: String) -> Keychain {
Keychain.swift:444
        return Keychain(options)
Keychain.swift:447
    public func comment(comment: String) -> Keychain {
Keychain.swift:450
        return Keychain(options)
Keychain.swift:453
    public func attributes(attributes: [String: AnyObject]) -> Keychain {
Keychain.swift:456
        return Keychain(options)
Keychain.swift:461
    public func authenticationPrompt(authenticationPrompt: String) -> Keychain {
Keychain.swift:464
        return Keychain(options)
Keychain.swift:1121
extension Keychain : CustomStringConvertible, CustomDebugStringConvertible {
{ 0315 public var itemClass
Keychain.swift:734
        return self.dynamicType.prettify(itemClass: itemClass, items: items()).map { $0["key"] as! String }
Keychain.swift:764
        return self.dynamicType.prettify(itemClass: itemClass, items: items())
: ItemClass { 0316 return options.itemClass 0317 } 0318 0319 public var service: String { 0320 return options.service 0321 } 0322 0323 public var accessGroup: String? { 0324 return options.accessGroup 0325 } 0326 0327 public var server: NSURL { 0328 return options.server 0329 } 0330 0331 public var protocolType: ProtocolType { 0332 return options.protocolType 0333 } 0334 0335 public var authenticationType: AuthenticationType { 0336 return options.authenticationType 0337 } 0338 0339 public var accessibility: Accessibility { 0340 return options.accessibility 0341 } 0342 0343 @available(iOS 8.0, OSX 10.10, *) 0344 @available(watchOS, unavailable) 0345 public var authenticationPolicy: AuthenticationPolicy? { 0346 return options.authenticationPolicy 0347 } 0348 0349 public var synchronizable: Bool { 0350 return options.synchronizable 0351 } 0352 0353 public var label: String? { 0354 return options.label 0355 } 0356 0357 public var comment: String? { 0358 return options.comment 0359 } 0360 0361 @available(iOS 8.0, OSX 10.10, *) 0362 @available(watchOS, unavailable) 0363 public var authenticationPrompt: String? { 0364 return options.authenticationPrompt 0365 } 0366 0367 private let options
Keychain.swift:316
        return options.itemClass
Keychain.swift:320
        return options.service
Keychain.swift:324
        return options.accessGroup
Keychain.swift:328
        return options.server
Keychain.swift:332
        return options.protocolType
Keychain.swift:336
        return options.authenticationType
Keychain.swift:340
        return options.accessibility
Keychain.swift:346
        return options.authenticationPolicy
Keychain.swift:350
        return options.synchronizable
Keychain.swift:354
        return options.label
Keychain.swift:358
        return options.comment
Keychain.swift:364
        return options.authenticationPrompt
Keychain.swift:415
        options = opts
Keychain.swift:421
        var options = self.options
Keychain.swift:429
        var options = self.options
Keychain.swift:436
        var options = self.options
Keychain.swift:442
        var options = self.options
Keychain.swift:448
        var options = self.options
Keychain.swift:454
        var options = self.options
Keychain.swift:462
        var options = self.options
Keychain.swift:484
        var query = options.query()
Keychain.swift:508
        var query = options.query()
Keychain.swift:545
        var query = options.query()
Keychain.swift:562
            var query = options.query()
Keychain.swift:565
            var (attributes, error) = options.attributes(key: nil, value: value)
Keychain.swift:571
            options.attributes.forEach { attributes.updateValue($1, forKey: $0) }
Keychain.swift:590
            var (attributes, error) = options.attributes(key: key, value: value)
Keychain.swift:596
            options.attributes.forEach { attributes.updateValue($1, forKey: $0) }
Keychain.swift:662
        var query = options.query()
Keychain.swift:672
        var query = options.query()
Keychain.swift:686
        var query = options.query()
Keychain.swift:910
        var query = options.query()
: Options 0368 0369 // MARK: 0370 0371 public convenience init() { 0372 var options = Options() 0373 if let bundleIdentifier = NSBundle.mainBundle().bundleIdentifier { 0374 options.service = bundleIdentifier 0375 } 0376 self.init(options) 0377 } 0378 0379 public convenience init(service: String) { 0380 var options = Options() 0381 options.service = service 0382 self.init(options) 0383 } 0384 0385 public convenience init(accessGroup: String) { 0386 var options = Options() 0387 if let bundleIdentifier = NSBundle.mainBundle().bundleIdentifier { 0388 options.service = bundleIdentifier 0389 } 0390 options.accessGroup = accessGroup 0391 self.init(options) 0392 } 0393 0394 public convenience init(service: String, accessGroup: String) { 0395 var options = Options() 0396 options.service = service 0397 options.accessGroup = accessGroup 0398 self.init(options) 0399 } 0400 0401 public convenience init(server: String, protocolType: ProtocolType, authenticationType: AuthenticationType = .Default) { 0402 self.init(server: NSURL(string: server)!, protocolType: protocolType, authenticationType: authenticationType) 0403 } 0404 0405 public convenience init
Keychain.swift:402
        self.init(server: NSURL(string: server)!, protocolType: protocolType, authenticationType: authenticationType)
(server: NSURL, protocolType: ProtocolType, authenticationType: AuthenticationType = .Default) { 0406 var options = Options() 0407 options.itemClass = .InternetPassword 0408 options.server = server 0409 options.protocolType = protocolType 0410 options.authenticationType = authenticationType 0411 self.init(options) 0412 } 0413 0414 private init
Keychain.swift:376
        self.init(options)
Keychain.swift:382
        self.init(options)
Keychain.swift:391
        self.init(options)
Keychain.swift:398
        self.init(options)
Keychain.swift:411
        self.init(options)
Keychain.swift:423
        return Keychain(options)
Keychain.swift:432
        return Keychain(options)
Keychain.swift:438
        return Keychain(options)
Keychain.swift:444
        return Keychain(options)
Keychain.swift:450
        return Keychain(options)
Keychain.swift:456
        return Keychain(options)
Keychain.swift:464
        return Keychain(options)
(_ opts: Options) { 0415 options = opts 0416 } 0417 0418 // MARK: 0419 0420 public func accessibility(accessibility: Accessibility) -> Keychain { 0421 var options = self.options 0422 options.accessibility = accessibility 0423 return Keychain(options) 0424 } 0425 0426 @available(iOS 8.0, OSX 10.10, *) 0427 @available(watchOS, unavailable) 0428 public func accessibility(accessibility: Accessibility, authenticationPolicy: AuthenticationPolicy) -> Keychain { 0429 var options = self.options 0430 options.accessibility = accessibility 0431 options.authenticationPolicy = authenticationPolicy 0432 return Keychain(options) 0433 } 0434 0435 public func synchronizable(synchronizable: Bool) -> Keychain { 0436 var options = self.options 0437 options.synchronizable = synchronizable 0438 return Keychain(options) 0439 } 0440 0441 public func label(label: String) -> Keychain { 0442 var options = self.options 0443 options.label = label 0444 return Keychain(options) 0445 } 0446 0447 public func comment(comment: String) -> Keychain { 0448 var options = self.options 0449 options.comment = comment 0450 return Keychain(options) 0451 } 0452 0453 public func attributes(attributes: [String: AnyObject]) -> Keychain { 0454 var options = self.options 0455 attributes.forEach { options.attributes.updateValue($1, forKey: $0) } 0456 return Keychain(options) 0457 } 0458 0459 @available(iOS 8.0, OSX 10.10, *) 0460 @available(watchOS, unavailable) 0461 public func authenticationPrompt(authenticationPrompt: String) -> Keychain { 0462 var options = self.options 0463 options.authenticationPrompt = authenticationPrompt 0464 return Keychain(options) 0465 } 0466 0467 // MARK: 0468 0469 public func get
Keychain.swift:609
            return (try? get(key)).flatMap { $0 }
(key: String) throws -> String? { 0470 return try getString(key) 0471 } 0472 0473 public func getString
Keychain.swift:470
        return try getString(key)
(key: String) throws -> String? { 0474 guard let data = try getData(key) else { 0475 return nil 0476 } 0477 guard let string = NSString(data: data, encoding: NSUTF8StringEncoding) as? String else { 0478 throw conversionError(message: "failed to convert data to string") 0479 } 0480 return string 0481 } 0482 0483 public func getData
Keychain.swift:474
        guard let data = try getData(key) else  {
Keychain.swift:637
            return (try? getData(key)).flatMap { $0 }
(key: String) throws -> NSData? { 0484 var query = options.query() 0485 0486 query[MatchLimit] = MatchLimitOne 0487 query[ReturnData] = true 0488 0489 query[AttributeAccount] = key 0490 0491 var result: AnyObject? 0492 let status = withUnsafeMutablePointer(&result) { SecItemCopyMatching(query, UnsafeMutablePointer($0)) } 0493 0494 switch status { 0495 case errSecSuccess: 0496 guard let data = result as? NSData else { 0497 throw Status.UnexpectedError 0498 } 0499 return data 0500 case errSecItemNotFound: 0501 return nil 0502 default: 0503 throw securityError(status: status) 0504 } 0505 } 0506 0507 public func get
Keychain.swift:655
            return (try? get(key) { $0 }).flatMap { $0 }
<T>(key: String, @noescape handler: Attributes? -> T) throws -> T { 0508 var query = options.query() 0509 0510 query[MatchLimit] = MatchLimitOne 0511 0512 query[ReturnData] = true 0513 query[ReturnAttributes] = true 0514 query[ReturnRef] = true 0515 query[ReturnPersistentRef] = true 0516 0517 query[AttributeAccount] = key 0518 0519 var result: AnyObject? 0520 let status = withUnsafeMutablePointer(&result) { SecItemCopyMatching(query, UnsafeMutablePointer($0)) } 0521 0522 switch status { 0523 case errSecSuccess: 0524 guard let attributes = result as? [String: AnyObject] else { 0525 throw Status.UnexpectedError 0526 } 0527 return handler(Attributes(attributes: attributes)) 0528 case errSecItemNotFound: 0529 return handler(nil) 0530 default: 0531 throw securityError(status: status) 0532 } 0533 } 0534 0535 // MARK: 0536 0537 public func set
Keychain.swift:615
                    try set(value, key: key)
(value: String, key: String) throws { 0538 guard let data = value.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false) else { 0539 throw conversionError(message: "failed to convert string to data") 0540 } 0541 try set(data, key: key) 0542 } 0543 0544 public func set
Keychain.swift:541
        try set(data, key: key)
Keychain.swift:643
                    try set(value, key: key)
(value: NSData, key: String) throws { 0545 var query = options.query() 0546 query[AttributeAccount] = key 0547 #if os(iOS) 0548 if #available(iOS 9.0, *) { 0549 query[UseAuthenticationUI] = UseAuthenticationUIFail 0550 } else { 0551 query[UseNoAuthenticationUI] = true 0552 } 0553 #elseif os(OSX) 0554 if #available(OSX 10.11, *) { 0555 query[UseAuthenticationUI] = UseAuthenticationUIFail 0556 } 0557 #endif 0558 0559 var status = SecItemCopyMatching(query, nil) 0560 switch status { 0561 case errSecSuccess, errSecInteractionNotAllowed: 0562 var query = options.query() 0563 query[AttributeAccount] = key 0564 0565 var (attributes, error) = options.attributes(key: nil, value: value) 0566 if let error = error { 0567 print(error.localizedDescription) 0568 throw error 0569 } 0570 0571 options.attributes.forEach { attributes.updateValue($1, forKey: $0) } 0572 0573 #if os(iOS) 0574 if status == errSecInteractionNotAllowed && floor(NSFoundationVersionNumber) <= floor(NSFoundationVersionNumber_iOS_8_0) { 0575 try remove(key) 0576 try set(value, key: key) 0577 } else { 0578 status = SecItemUpdate(query, attributes) 0579 if status != errSecSuccess { 0580 throw securityError(status: status) 0581 } 0582 } 0583 #else 0584 status = SecItemUpdate(query, attributes) 0585 if status != errSecSuccess { 0586 throw securityError(status: status) 0587 } 0588 #endif 0589 case errSecItemNotFound: 0590 var (attributes, error) = options.attributes(key: key, value: value) 0591 if let error = error { 0592 print(error.localizedDescription) 0593 throw error 0594 } 0595 0596 options.attributes.forEach { attributes.updateValue($1, forKey: $0) } 0597 0598 status = SecItemAdd(attributes, nil) 0599 if status != errSecSuccess { 0600 throw securityError(status: status) 0601 } 0602 default: 0603 throw securityError(status: status) 0604 } 0605 } 0606 0607 public subscript
Keychain.swift:627
            return self[key]
Keychain.swift:631
            self[key] = newValue
(key: String) -> String? { 0608 get { 0609 return (try? get(key)).flatMap { $0 } 0610 } 0611 0612 set { 0613 if let value = newValue { 0614 do { 0615 try set(value, key: key) 0616 } catch {} 0617 } else { 0618 do { 0619 try remove(key) 0620 } catch {} 0621 } 0622 } 0623 } 0624 0625 public subscript(string key: String) -> String? { 0626 get { 0627 return self[key] 0628 } 0629 0630 set { 0631 self[key] = newValue 0632 } 0633 } 0634 0635 public subscript(data key: String) -> NSData? { 0636 get { 0637 return (try? getData(key)).flatMap { $0 } 0638 } 0639 0640 set { 0641 if let value = newValue { 0642 do { 0643 try set(value, key: key) 0644 } catch {} 0645 } else { 0646 do { 0647 try remove(key) 0648 } catch {} 0649 } 0650 } 0651 } 0652 0653 public subscript(attributes key: String) -> Attributes? { 0654 get { 0655 return (try? get(key) { $0 }).flatMap { $0 } 0656 } 0657 } 0658 0659 // MARK: 0660 0661 public func remove
Keychain.swift:619
                    try remove(key)
Keychain.swift:647
                    try remove(key)
(key: String) throws { 0662 var query = options.query() 0663 query[AttributeAccount] = key 0664 0665 let status = SecItemDelete(query) 0666 if status != errSecSuccess && status != errSecItemNotFound { 0667 throw securityError(status: status) 0668 } 0669 } 0670 0671 public func removeAll() throws { 0672 var query = options.query() 0673 #if !os(iOS) && !os(watchOS) && !os(tvOS) 0674 query[MatchLimit] = MatchLimitAll 0675 #endif 0676 0677 let status = SecItemDelete(query) 0678 if status != errSecSuccess && status != errSecItemNotFound { 0679 throw securityError(status: status) 0680 } 0681 } 0682 0683 // MARK: 0684 0685 public func contains(key: String) throws -> Bool { 0686 var query = options.query() 0687 query[AttributeAccount] = key 0688 0689 let status = SecItemCopyMatching(query, nil) 0690 switch status { 0691 case errSecSuccess: 0692 return true 0693 case errSecItemNotFound: 0694 return false 0695 default: 0696 throw securityError(status: status) 0697 } 0698 } 0699 0700 // MARK: 0701 0702 public class func allKeys(itemClass: ItemClass) -> [(String, String)] { 0703 var query = [String: AnyObject]() 0704 query[Class] = itemClass.rawValue 0705 query[AttributeSynchronizable] = SynchronizableAny 0706 query[MatchLimit] = MatchLimitAll 0707 query[ReturnAttributes] = true 0708 0709 var result: AnyObject? 0710 let status = withUnsafeMutablePointer(&result) { SecItemCopyMatching(query, UnsafeMutablePointer($0)) } 0711 0712 switch status { 0713 case errSecSuccess: 0714 if let items = result as? [[String: AnyObject]] { 0715 return prettify(itemClass: itemClass, items: items).map { 0716 switch itemClass { 0717 case .GenericPassword: 0718 return (($0["service"] ?? "") as! String, ($0["key"] ?? "") as! String) 0719 case .InternetPassword: 0720 return (($0["server"] ?? "") as! String, ($0["key"] ?? "") as! String) 0721 } 0722 } 0723 } 0724 case errSecItemNotFound: 0725 return [] 0726 default: () 0727 } 0728 0729 securityError(status: status) 0730 return [] 0731 } 0732 0733 public func allKeys() -> [String] { 0734 return self.dynamicType.prettify(itemClass: itemClass, items: items()).map { $0["key"] as! String } 0735 } 0736 0737 public class func allItems(itemClass: ItemClass) -> [[String: AnyObject]] { 0738 var query = [String: AnyObject]() 0739 query[Class] = itemClass.rawValue 0740 query[MatchLimit] = MatchLimitAll 0741 query[ReturnAttributes] = true 0742 #if os(iOS) || os(watchOS) || os(tvOS) 0743 query[ReturnData] = true 0744 #endif 0745 0746 var result: AnyObject? 0747 let status = withUnsafeMutablePointer(&result) { SecItemCopyMatching(query, UnsafeMutablePointer($0)) } 0748 0749 switch status { 0750 case errSecSuccess: 0751 if let items = result as? [[String: AnyObject]] { 0752 return prettify(itemClass: itemClass, items: items) 0753 } 0754 case errSecItemNotFound: 0755 return [] 0756 default: () 0757 } 0758 0759 securityError(status: status) 0760 return [] 0761 } 0762 0763 public func allItems
Keychain.swift:1123
        let items = allItems()
() -> [[String: AnyObject]] { 0764 return self.dynamicType.prettify(itemClass: itemClass, items: items()) 0765 } 0766 0767 #if os(iOS) 0768 @available(iOS 8.0, *) 0769 public func getSharedPassword(completion: (account: String?, password: String?, error: NSError?) -> () = { account, password, error -> () in }) { 0770 if let domain = server.host { 0771 self.dynamicType.requestSharedWebCredential(domain: domain, account: nil) { (credentials, error) -> () in 0772 if let credential = credentials.first { 0773 let account = credential["account"] 0774 let password = credential["password"] 0775 completion(account: account, password: password, error: error) 0776 } else { 0777 completion(account: nil, password: nil, error: error) 0778 } 0779 } 0780 } else { 0781 let error = securityError(status: Status.Param.rawValue) 0782 completion(account: nil, password: nil, error: error) 0783 } 0784 } 0785 #endif 0786 0787 #if os(iOS) 0788 @available(iOS 8.0, *) 0789 public func getSharedPassword(account: String, completion: (password: String?, error: NSError?) -> () = { password, error -> () in }) { 0790 if let domain = server.host { 0791 self.dynamicType.requestSharedWebCredential(domain: domain, account: account) { (credentials, error) -> () in 0792 if let credential = credentials.first { 0793 if let password = credential["password"] { 0794 completion(password: password, error: error) 0795 } else { 0796 completion(password: nil, error: error) 0797 } 0798 } else { 0799 completion(password: nil, error: error) 0800 } 0801 } 0802 } else { 0803 let error = securityError(status: Status.Param.rawValue) 0804 completion(password: nil, error: error) 0805 } 0806 } 0807 #endif 0808 0809 #if os(iOS) 0810 @available(iOS 8.0, *) 0811 public func setSharedPassword(password: String, account: String, completion: (error: NSError?) -> () = { e -> () in }) { 0812 setSharedPassword(password as String?, account: account, completion: completion) 0813 } 0814 #endif 0815 0816 #if os(iOS) 0817 @available(iOS 8.0, *) 0818 private func setSharedPassword(password: String?, account: String, completion: (error: NSError?) -> () = { e -> () in }) { 0819 if let domain = server.host { 0820 SecAddSharedWebCredential(domain, account, password) { error -> () in 0821 if let error = error { 0822 completion(error: error.error) 0823 } else { 0824 completion(error: nil) 0825 } 0826 } 0827 } else { 0828 let error = securityError(status: Status.Param.rawValue) 0829 completion(error: error) 0830 } 0831 } 0832 #endif 0833 0834 #if os(iOS) 0835 @available(iOS 8.0, *) 0836 public func removeSharedPassword(account: String, completion: (error: NSError?) -> () = { e -> () in }) { 0837 setSharedPassword(nil, account: account, completion: completion) 0838 } 0839 #endif 0840 0841 #if os(iOS) 0842 @available(iOS 8.0, *) 0843 public class func requestSharedWebCredential(completion: (credentials: [[String: String]], error: NSError?) -> () = { credentials, error -> () in }) { 0844 requestSharedWebCredential(domain: nil, account: nil, completion: completion) 0845 } 0846 #endif 0847 0848 #if os(iOS) 0849 @available(iOS 8.0, *) 0850 public class func requestSharedWebCredential(domain domain: String, completion: (credentials: [[String: String]], error: NSError?) -> () = { credentials, error -> () in }) { 0851 requestSharedWebCredential(domain: domain, account: nil, completion: completion) 0852 } 0853 #endif 0854 0855 #if os(iOS) 0856 @available(iOS 8.0, *) 0857 public class func requestSharedWebCredential(domain domain: String, account: String, completion: (credentials: [[String: String]], error: NSError?) -> () = { credentials, error -> () in }) { 0858 requestSharedWebCredential(domain: Optional(domain), account: Optional(account), completion: completion) 0859 } 0860 #endif 0861 0862 #if os(iOS) 0863 @available(iOS 8.0, *) 0864 private class func requestSharedWebCredential(domain domain: String?, account: String?, completion: (credentials: [[String: String]], error: NSError?) -> ()) { 0865 SecRequestSharedWebCredential(domain, account) { (credentials, error) -> () in 0866 var remoteError: NSError? 0867 if let error = error { 0868 remoteError = error.error 0869 if remoteError?.code != Int(errSecItemNotFound) { 0870 print("error:[\(remoteError!.code)] \(remoteError!.localizedDescription)") 0871 } 0872 } 0873 if let credentials = credentials { 0874 let casted = credentials as NSArray 0875 let credentials = casted.map { credentials -> [String: String] in 0876 var credential = [String: String]() 0877 if let server = credentials[AttributeServer] as? String { 0878 credential["server"] = server 0879 } 0880 if let account = credentials[AttributeAccount] as? String { 0881 credential["account"] = account 0882 } 0883 if let password = credentials[SharedPassword] as? String { 0884 credential["password"] = password 0885 } 0886 return credential 0887 } 0888 completion(credentials: credentials, error: remoteError) 0889 } else { 0890 completion(credentials: [], error: remoteError) 0891 } 0892 } 0893 } 0894 #endif 0895 0896 #if os(iOS) 0897 /** 0898 @abstract Returns a randomly generated password. 0899 @return String password in the form xxx-xxx-xxx-xxx where x is taken from the sets "abcdefghkmnopqrstuvwxy", "ABCDEFGHJKLMNPQRSTUVWXYZ", "3456789" with at least one character from each set being present. 0900 */ 0901 @available(iOS 8.0, *) 0902 public class func generatePassword() -> String { 0903 return SecCreateSharedWebCredentialPassword()! as String 0904 } 0905 #endif 0906 0907 // MARK: 0908 0909 private func items
Keychain.swift:734
        return self.dynamicType.prettify(itemClass: itemClass, items: items()).map { $0["key"] as! String }
Keychain.swift:764
        return self.dynamicType.prettify(itemClass: itemClass, items: items())
Keychain.swift:1137
        return "\(items())"
() -> [[String: AnyObject]] { 0910 var query = options.query() 0911 query[MatchLimit] = MatchLimitAll 0912 query[ReturnAttributes] = true 0913 #if os(iOS) || os(watchOS) || os(tvOS) 0914 query[ReturnData] = true 0915 #endif 0916 0917 var result: AnyObject? 0918 let status = withUnsafeMutablePointer(&result) { SecItemCopyMatching(query, UnsafeMutablePointer($0)) } 0919 0920 switch status { 0921 case errSecSuccess: 0922 if let items = result as? [[String: AnyObject]] { 0923 return items 0924 } 0925 case errSecItemNotFound: 0926 return [] 0927 default: () 0928 } 0929 0930 securityError(status: status) 0931 return [] 0932 } 0933 0934 private class func prettify
Keychain.swift:715
                return prettify(itemClass: itemClass, items: items).map {
Keychain.swift:734
        return self.dynamicType.prettify(itemClass: itemClass, items: items()).map { $0["key"] as! String }
Keychain.swift:752
                return prettify(itemClass: itemClass, items: items)
Keychain.swift:764
        return self.dynamicType.prettify(itemClass: itemClass, items: items())
(itemClass itemClass: ItemClass, items: [[String: AnyObject]]) -> [[String: AnyObject]] { 0935 let items = items.map { attributes -> [String: AnyObject] in 0936 var item = [String: AnyObject]() 0937 0938 item["class"] = itemClass.description 0939 0940 switch itemClass { 0941 case .GenericPassword: 0942 if let service = attributes[AttributeService] as? String { 0943 item["service"] = service 0944 } 0945 if let accessGroup = attributes[AttributeAccessGroup] as? String { 0946 item["accessGroup"] = accessGroup 0947 } 0948 case .InternetPassword: 0949 if let server = attributes[AttributeServer] as? String { 0950 item["server"] = server 0951 } 0952 if let proto = attributes[AttributeProtocol] as? String { 0953 if let protocolType = ProtocolType(rawValue: proto) { 0954 item["protocol"] = protocolType.description 0955 } 0956 } 0957 if let auth = attributes[AttributeAuthenticationType] as? String { 0958 if let authenticationType = AuthenticationType(rawValue: auth) { 0959 item["authenticationType"] = authenticationType.description 0960 } 0961 } 0962 } 0963 0964 if let key = attributes[AttributeAccount] as? String { 0965 item["key"] = key 0966 } 0967 if let data = attributes[ValueData] as? NSData { 0968 if let text = NSString(data: data, encoding: NSUTF8StringEncoding) as? String { 0969 item["value"] = text 0970 } else { 0971 item["value"] = data 0972 } 0973 } 0974 0975 if let accessible = attributes[AttributeAccessible] as? String { 0976 if let accessibility = Accessibility(rawValue: accessible) { 0977 item["accessibility"] = accessibility.description 0978 } 0979 } 0980 if let synchronizable = attributes[AttributeSynchronizable] as? Bool { 0981 item["synchronizable"] = synchronizable ? "true" : "false" 0982 } 0983 0984 return item 0985 } 0986 return items 0987 } 0988 0989 // MARK: 0990 0991 private class func conversionError
Keychain.swift:999
        return self.dynamicType.conversionError(message: message)
(message message: String) -> NSError { 0992 let error = NSError(domain: KeychainAccessErrorDomain, code: Int(Status.ConversionError.rawValue), userInfo: [NSLocalizedDescriptionKey: message]) 0993 print("error:[\(error.code)] \(error.localizedDescription)") 0994 0995 return error 0996 } 0997 0998 private func conversionError
Keychain.swift:478
            throw conversionError(message: "failed to convert data to string")
Keychain.swift:539
            throw conversionError(message: "failed to convert string to data")
(message message: String) -> NSError { 0999 return self.dynamicType.conversionError(message: message) 1000 } 1001 1002 private class func securityError
Keychain.swift:729
        securityError(status: status)
Keychain.swift:759
        securityError(status: status)
Keychain.swift:1012
        return self.dynamicType.securityError(status: status)
(status status: OSStatus) -> NSError { 1003 let message = Status(status: status).description 1004 1005 let error = NSError(domain: KeychainAccessErrorDomain, code: Int(status), userInfo: [NSLocalizedDescriptionKey: message]) 1006 print("OSStatus error:[\(error.code)] \(error.localizedDescription)") 1007 1008 return error 1009 } 1010 1011 private func securityError
Keychain.swift:503
            throw securityError(status: status)
Keychain.swift:531
            throw securityError(status: status)
Keychain.swift:586
                throw securityError(status: status)
Keychain.swift:600
                throw securityError(status: status)
Keychain.swift:603
            throw securityError(status: status)
Keychain.swift:667
            throw securityError(status: status)
Keychain.swift:679
            throw securityError(status: status)
Keychain.swift:696
            throw securityError(status: status)
Keychain.swift:930
        securityError(status: status)
(status status: OSStatus) -> NSError { 1012 return self.dynamicType.securityError(status: status) 1013 } 1014 } 1015 1016 struct Options
Keychain.swift:367
    private let options: Options
Keychain.swift:372
        var options = Options()
Keychain.swift:380
        var options = Options()
Keychain.swift:386
        var options = Options()
Keychain.swift:395
        var options = Options()
Keychain.swift:406
        var options = Options()
Keychain.swift:414
    private init(_ opts: Options) {
Keychain.swift:1141
extension Options {
{ 1017 var itemClass
Keychain.swift:316
        return options.itemClass
Keychain.swift:407
        options.itemClass = .InternetPassword
Keychain.swift:1146
        query[Class] = itemClass.rawValue
Keychain.swift:1149
        switch itemClass {
: ItemClass = .GenericPassword 1018 1019 var service
Keychain.swift:320
        return options.service
Keychain.swift:374
            options.service = bundleIdentifier
Keychain.swift:381
        options.service = service
Keychain.swift:388
            options.service = bundleIdentifier
Keychain.swift:396
        options.service = service
Keychain.swift:1151
            query[AttributeService] = service
: String = "" 1020 var accessGroup
Keychain.swift:324
        return options.accessGroup
Keychain.swift:390
        options.accessGroup = accessGroup
Keychain.swift:397
        options.accessGroup = accessGroup
Keychain.swift:1154
            if let accessGroup = self.accessGroup {
: String? = nil 1021 1022 var server
Keychain.swift:328
        return options.server
Keychain.swift:408
        options.server = server
Keychain.swift:1159
            query[AttributeServer] = server.host
Keychain.swift:1160
            query[AttributePort] = server.port
: NSURL! 1023 var protocolType
Keychain.swift:332
        return options.protocolType
Keychain.swift:409
        options.protocolType = protocolType
Keychain.swift:1161
            query[AttributeProtocol] = protocolType.rawValue
: ProtocolType! 1024 var authenticationType
Keychain.swift:336
        return options.authenticationType
Keychain.swift:410
        options.authenticationType = authenticationType
Keychain.swift:1162
            query[AttributeAuthenticationType] = authenticationType.rawValue
: AuthenticationType = .Default 1025 1026 var accessibility
Keychain.swift:340
        return options.accessibility
Keychain.swift:422
        options.accessibility = accessibility
Keychain.swift:430
        options.accessibility = accessibility
Keychain.swift:1196
                guard let accessControl = SecAccessControlCreateWithFlags(kCFAllocatorDefault, accessibility.rawValue, SecAccessControlCreateFlags(rawValue: policy.rawValue), &error) else {
Keychain.swift:1208
            attributes[AttributeAccessible] = accessibility.rawValue
: Accessibility = .AfterFirstUnlock 1027 var authenticationPolicy
Keychain.swift:346
        return options.authenticationPolicy
Keychain.swift:431
        options.authenticationPolicy = authenticationPolicy
Keychain.swift:1193
        if let policy = authenticationPolicy {
: AuthenticationPolicy? 1028 1029 var synchronizable
Keychain.swift:350
        return options.synchronizable
Keychain.swift:437
        options.synchronizable = synchronizable
Keychain.swift:1211
        attributes[AttributeSynchronizable] = synchronizable
: Bool = false 1030 1031 var label
Keychain.swift:354
        return options.label
Keychain.swift:443
        options.label = label
Keychain.swift:1186
        if label != nil {
Keychain.swift:1187
            attributes[AttributeLabel] = label
: String? 1032 var comment
Keychain.swift:358
        return options.comment
Keychain.swift:449
        options.comment = comment
Keychain.swift:1189
        if comment != nil {
Keychain.swift:1190
            attributes[AttributeComment] = comment
: String? 1033 1034 var authenticationPrompt
Keychain.swift:364
        return options.authenticationPrompt
Keychain.swift:463
        options.authenticationPrompt = authenticationPrompt
Keychain.swift:1166
            if authenticationPrompt != nil {
Keychain.swift:1167
                query[UseOperationPrompt] = authenticationPrompt
: String? 1035 1036 var attributes
Keychain.swift:455
        attributes.forEach { options.attributes.updateValue($1, forKey: $0) }
Keychain.swift:571
            options.attributes.forEach { attributes.updateValue($1, forKey: $0) }
Keychain.swift:596
            options.attributes.forEach { attributes.updateValue($1, forKey: $0) }
= [String: AnyObject]() 1037 } 1038 1039 /** Class Key Constant */ 1040 private let Class
Keychain.swift:215
        return attributes[Class] as? String
Keychain.swift:704
        query[Class] = itemClass.rawValue
Keychain.swift:739
        query[Class] = itemClass.rawValue
Keychain.swift:1146
        query[Class] = itemClass.rawValue
= String(kSecClass) 1041 1042 /** Attribute Key Constants */ 1043 private let AttributeAccessible
Keychain.swift:228
        return attributes[AttributeAccessible] as? String
Keychain.swift:975
            if let accessible = attributes[AttributeAccessible] as? String {
Keychain.swift:1208
            attributes[AttributeAccessible] = accessibility.rawValue
= String(kSecAttrAccessible) 1044 1045 @available(iOS 8.0, OSX 10.10, *) 1046 private let AttributeAccessControl
Keychain.swift:232
            if let accessControl = attributes[AttributeAccessControl] {
Keychain.swift:1203
                attributes[AttributeAccessControl] = accessControl
= String(kSecAttrAccessControl) 1047 1048 private let AttributeAccessGroup
Keychain.swift:241
        return attributes[AttributeAccessGroup] as? String
Keychain.swift:945
                if let accessGroup = attributes[AttributeAccessGroup] as? String {
Keychain.swift:1155
                query[AttributeAccessGroup] = accessGroup
= String(kSecAttrAccessGroup) 1049 private let AttributeSynchronizable
Keychain.swift:244
        return attributes[AttributeSynchronizable] as? Bool
Keychain.swift:705
        query[AttributeSynchronizable] = SynchronizableAny
Keychain.swift:980
            if let synchronizable = attributes[AttributeSynchronizable] as? Bool {
Keychain.swift:1147
        query[AttributeSynchronizable] = SynchronizableAny
Keychain.swift:1211
        attributes[AttributeSynchronizable] = synchronizable
= String(kSecAttrSynchronizable) 1050 private let AttributeCreationDate
Keychain.swift:247
        return attributes[AttributeCreationDate] as? NSDate
= String(kSecAttrCreationDate) 1051 private let AttributeModificationDate
Keychain.swift:250
        return attributes[AttributeModificationDate] as? NSDate
= String(kSecAttrModificationDate) 1052 private let AttributeDescription
Keychain.swift:253
        return attributes[AttributeDescription] as? String
= String(kSecAttrDescription) 1053 private let AttributeComment
Keychain.swift:256
        return attributes[AttributeComment] as? String
Keychain.swift:1190
            attributes[AttributeComment] = comment
= String(kSecAttrComment) 1054 private let AttributeCreator
Keychain.swift:259
        return attributes[AttributeCreator] as? String
= String(kSecAttrCreator) 1055 private let AttributeType
Keychain.swift:262
        return attributes[AttributeType] as? String
= String(kSecAttrType) 1056 private let AttributeLabel
Keychain.swift:265
        return attributes[AttributeLabel] as? String
Keychain.swift:1187
            attributes[AttributeLabel] = label
= String(kSecAttrLabel) 1057 private let AttributeIsInvisible
Keychain.swift:268
        return attributes[AttributeIsInvisible] as? Bool
= String(kSecAttrIsInvisible) 1058 private let AttributeIsNegative
Keychain.swift:271
        return attributes[AttributeIsNegative] as? Bool
= String(kSecAttrIsNegative) 1059 private let AttributeAccount
Keychain.swift:274
        return attributes[AttributeAccount] as? String
Keychain.swift:489
        query[AttributeAccount] = key
Keychain.swift:517
        query[AttributeAccount] = key
Keychain.swift:546
        query[AttributeAccount] = key
Keychain.swift:563
            query[AttributeAccount] = key
Keychain.swift:663
        query[AttributeAccount] = key
Keychain.swift:687
        query[AttributeAccount] = key
Keychain.swift:964
            if let key = attributes[AttributeAccount] as? String {
Keychain.swift:1179
            attributes[AttributeAccount] = key
= String(kSecAttrAccount) 1060 private let AttributeService
Keychain.swift:277
        return attributes[AttributeService] as? String
Keychain.swift:942
                if let service = attributes[AttributeService] as? String {
Keychain.swift:1151
            query[AttributeService] = service
= String(kSecAttrService) 1061 private let AttributeGeneric
Keychain.swift:280
        return attributes[AttributeGeneric] as? NSData
= String(kSecAttrGeneric) 1062 private let AttributeSecurityDomain
Keychain.swift:283
        return attributes[AttributeSecurityDomain] as? String
= String(kSecAttrSecurityDomain) 1063 private let AttributeServer
Keychain.swift:286
        return attributes[AttributeServer] as? String
Keychain.swift:949
                if let server = attributes[AttributeServer] as? String {
Keychain.swift:1159
            query[AttributeServer] = server.host
= String(kSecAttrServer) 1064 private let AttributeProtocol
Keychain.swift:289
        return attributes[AttributeProtocol] as? String
Keychain.swift:952
                if let proto = attributes[AttributeProtocol] as? String {
Keychain.swift:1161
            query[AttributeProtocol] = protocolType.rawValue
= String(kSecAttrProtocol) 1065 private let AttributeAuthenticationType
Keychain.swift:292
        return attributes[AttributeAuthenticationType] as? String
Keychain.swift:957
                if let auth = attributes[AttributeAuthenticationType] as? String {
Keychain.swift:1162
            query[AttributeAuthenticationType] = authenticationType.rawValue
= String(kSecAttrAuthenticationType) 1066 private let AttributePort
Keychain.swift:295
        return attributes[AttributePort] as? Int
Keychain.swift:1160
            query[AttributePort] = server.port
= String(kSecAttrPort) 1067 private let AttributePath
Keychain.swift:298
        return attributes[AttributePath] as? String
= String(kSecAttrPath) 1068 1069 private let SynchronizableAny
Keychain.swift:705
        query[AttributeSynchronizable] = SynchronizableAny
Keychain.swift:1147
        query[AttributeSynchronizable] = SynchronizableAny
= kSecAttrSynchronizableAny 1070 1071 /** Search Constants */ 1072 private let MatchLimit
Keychain.swift:486
        query[MatchLimit] = MatchLimitOne
Keychain.swift:510
        query[MatchLimit] = MatchLimitOne
Keychain.swift:674
        query[MatchLimit] = MatchLimitAll
Keychain.swift:706
        query[MatchLimit] = MatchLimitAll
Keychain.swift:740
        query[MatchLimit] = MatchLimitAll
Keychain.swift:911
        query[MatchLimit] = MatchLimitAll
= String(kSecMatchLimit) 1073 private let MatchLimitOne
Keychain.swift:486
        query[MatchLimit] = MatchLimitOne
Keychain.swift:510
        query[MatchLimit] = MatchLimitOne
= kSecMatchLimitOne 1074 private let MatchLimitAll
Keychain.swift:674
        query[MatchLimit] = MatchLimitAll
Keychain.swift:706
        query[MatchLimit] = MatchLimitAll
Keychain.swift:740
        query[MatchLimit] = MatchLimitAll
Keychain.swift:911
        query[MatchLimit] = MatchLimitAll
= kSecMatchLimitAll 1075 1076 /** Return Type Key Constants */ 1077 private let ReturnData
Keychain.swift:487
        query[ReturnData] = true
Keychain.swift:512
        query[ReturnData] = true
= String(kSecReturnData) 1078 private let ReturnAttributes
Keychain.swift:513
        query[ReturnAttributes] = true
Keychain.swift:707
        query[ReturnAttributes] = true
Keychain.swift:741
        query[ReturnAttributes] = true
Keychain.swift:912
        query[ReturnAttributes] = true
= String(kSecReturnAttributes) 1079 private let ReturnRef
Keychain.swift:514
        query[ReturnRef] = true
= String(kSecReturnRef) 1080 private let ReturnPersistentRef
Keychain.swift:515
        query[ReturnPersistentRef] = true
= String(kSecReturnPersistentRef) 1081 1082 /** Value Type Key Constants */ 1083 private let ValueData
Keychain.swift:218
        return attributes[ValueData] as? NSData
Keychain.swift:967
            if let data = attributes[ValueData] as? NSData {
Keychain.swift:1184
        attributes[ValueData] = value
= String(kSecValueData) 1084 private let ValueRef
Keychain.swift:221
        return attributes[ValueRef] as? NSData
= String(kSecValueRef) 1085 private let ValuePersistentRef
Keychain.swift:224
        return attributes[ValuePersistentRef] as? NSData
= String(kSecValuePersistentRef) 1086 1087 /** Other Constants */ 1088 @available(iOS 8.0, OSX 10.10, *) 1089 private let UseOperationPrompt
Keychain.swift:1167
                query[UseOperationPrompt] = authenticationPrompt
= String(kSecUseOperationPrompt) 1090 1091 #if os(iOS) 1092 @available(iOS, introduced=8.0, deprecated=9.0, message="Use a UseAuthenticationUI instead.") 1093 private let UseNoAuthenticationUI = String(kSecUseNoAuthenticationUI) 1094 #endif 1095 1096 @available(iOS 9.0, OSX 10.11, *) 1097 @available(watchOS, unavailable) 1098 private let UseAuthenticationUI
Keychain.swift:555
            query[UseAuthenticationUI] = UseAuthenticationUIFail
= String(kSecUseAuthenticationUI) 1099 1100 @available(iOS 9.0, OSX 10.11, *) 1101 @available(watchOS, unavailable) 1102 private let UseAuthenticationContext = String(kSecUseAuthenticationContext) 1103 1104 @available(iOS 9.0, OSX 10.11, *) 1105 @available(watchOS, unavailable) 1106 private let UseAuthenticationUIAllow = String(kSecUseAuthenticationUIAllow) 1107 1108 @available(iOS 9.0, OSX 10.11, *) 1109 @available(watchOS, unavailable) 1110 private let UseAuthenticationUIFail
Keychain.swift:555
            query[UseAuthenticationUI] = UseAuthenticationUIFail
= String(kSecUseAuthenticationUIFail) 1111 1112 @available(iOS 9.0, OSX 10.11, *) 1113 @available(watchOS, unavailable) 1114 private let UseAuthenticationUISkip = String(kSecUseAuthenticationUISkip) 1115 1116 #if os(iOS) 1117 /** Credential Key Constants */ 1118 private let SharedPassword = String(kSecSharedPassword) 1119 #endif 1120 1121 extension Keychain : CustomStringConvertible, CustomDebugStringConvertible { 1122 public var description: String { 1123 let items = allItems() 1124 if items.isEmpty { 1125 return "[]" 1126 } 1127 var description = "[\n" 1128 for item in items { 1129 description += " " 1130 description += "\(item)\n" 1131 } 1132 description += "]" 1133 return description 1134 } 1135 1136 public var debugDescription: String { 1137 return "\(items())" 1138 } 1139 } 1140 1141 extension Options { 1142 1143 func query
Keychain.swift:484
        var query = options.query()
Keychain.swift:508
        var query = options.query()
Keychain.swift:545
        var query = options.query()
Keychain.swift:562
            var query = options.query()
Keychain.swift:662
        var query = options.query()
Keychain.swift:672
        var query = options.query()
Keychain.swift:686
        var query = options.query()
Keychain.swift:910
        var query = options.query()
Keychain.swift:1178
            attributes = query()
() -> [String: AnyObject] { 1144 var query = [String: AnyObject]() 1145 1146 query[Class] = itemClass.rawValue 1147 query[AttributeSynchronizable] = SynchronizableAny 1148 1149 switch itemClass { 1150 case .GenericPassword: 1151 query[AttributeService] = service 1152 // Access group is not supported on any simulators. 1153 #if (!arch(i386) && !arch(x86_64)) || (!os(iOS) && !os(watchOS) && !os(tvOS)) 1154 if let accessGroup = self.accessGroup { 1155 query[AttributeAccessGroup] = accessGroup 1156 } 1157 #endif 1158 case .InternetPassword: 1159 query[AttributeServer] = server.host 1160 query[AttributePort] = server.port 1161 query[AttributeProtocol] = protocolType.rawValue 1162 query[AttributeAuthenticationType] = authenticationType.rawValue 1163 } 1164 1165 if #available(OSX 10.10, *) { 1166 if authenticationPrompt != nil { 1167 query[UseOperationPrompt] = authenticationPrompt 1168 } 1169 } 1170 1171 return query 1172 } 1173 1174 func attributes
Keychain.swift:565
            var (attributes, error) = options.attributes(key: nil, value: value)
Keychain.swift:590
            var (attributes, error) = options.attributes(key: key, value: value)
(key key: String?, value: NSData) -> ([String: AnyObject], NSError?) { 1175 var attributes: [String: AnyObject] 1176 1177 if key != nil { 1178 attributes = query() 1179 attributes[AttributeAccount] = key 1180 } else { 1181 attributes = [String: AnyObject]() 1182 } 1183 1184 attributes[ValueData] = value 1185 1186 if label != nil { 1187 attributes[AttributeLabel] = label 1188 } 1189 if comment != nil { 1190 attributes[AttributeComment] = comment 1191 } 1192 1193 if let policy = authenticationPolicy { 1194 if #available(OSX 10.10, *) { 1195 var error: Unmanaged<CFError>? 1196 guard let accessControl = SecAccessControlCreateWithFlags(kCFAllocatorDefault, accessibility.rawValue, SecAccessControlCreateFlags(rawValue: policy.rawValue), &error) else { 1197 if let error = error?.takeUnretainedValue() { 1198 return (attributes, error.error) 1199 } 1200 let message = Status.UnexpectedError.description 1201 return (attributes, NSError(domain: KeychainAccessErrorDomain, code: Int(Status.UnexpectedError.rawValue), userInfo: [NSLocalizedDescriptionKey: message])) 1202 } 1203 attributes[AttributeAccessControl] = accessControl 1204 } else { 1205 print("Unavailable 'Touch ID integration' on OS X versions prior to 10.10.") 1206 } 1207 } else { 1208 attributes[AttributeAccessible] = accessibility.rawValue 1209 } 1210 1211 attributes[AttributeSynchronizable] = synchronizable 1212 1213 return (attributes, nil) 1214 } 1215 } 1216 1217 // MARK: 1218 1219 extension Attributes : CustomStringConvertible, CustomDebugStringConvertible { 1220 public var description
Keychain.swift:1225
        return description
: String { 1221 return "\(attributes)" 1222 } 1223 1224 public var debugDescription: String { 1225 return description 1226 } 1227 } 1228 1229 extension ItemClass : RawRepresentable, CustomStringConvertible { 1230 1231 public init?(rawValue: String) { 1232 switch rawValue { 1233 case String(kSecClassGenericPassword): 1234 self = GenericPassword 1235 case String(kSecClassInternetPassword): 1236 self = InternetPassword 1237 default: 1238 return nil 1239 } 1240 } 1241 1242 public var rawValue
Keychain.swift:704
        query[Class] = itemClass.rawValue
Keychain.swift:739
        query[Class] = itemClass.rawValue
Keychain.swift:1146
        query[Class] = itemClass.rawValue
: String { 1243 switch self { 1244 case GenericPassword: 1245 return String(kSecClassGenericPassword) 1246 case InternetPassword: 1247 return String(kSecClassInternetPassword) 1248 } 1249 } 1250 1251 public var description
Keychain.swift:938
            item["class"] = itemClass.description
: String { 1252 switch self { 1253 case GenericPassword: 1254 return "GenericPassword" 1255 case InternetPassword: 1256 return "InternetPassword" 1257 } 1258 } 1259 } 1260 1261 extension ProtocolType : RawRepresentable, CustomStringConvertible { 1262 1263 public init
Keychain.swift:953
                    if let protocolType = ProtocolType(rawValue: proto) {
?(rawValue: String) { 1264 switch rawValue { 1265 case String(kSecAttrProtocolFTP): 1266 self = FTP 1267 case String(kSecAttrProtocolFTPAccount): 1268 self = FTPAccount 1269 case String(kSecAttrProtocolHTTP): 1270 self = HTTP 1271 case String(kSecAttrProtocolIRC): 1272 self = IRC 1273 case String(kSecAttrProtocolNNTP): 1274 self = NNTP 1275 case String(kSecAttrProtocolPOP3): 1276 self = POP3 1277 case String(kSecAttrProtocolSMTP): 1278 self = SMTP 1279 case String(kSecAttrProtocolSOCKS): 1280 self = SOCKS 1281 case String(kSecAttrProtocolIMAP): 1282 self = IMAP 1283 case String(kSecAttrProtocolLDAP): 1284 self = LDAP 1285 case String(kSecAttrProtocolAppleTalk): 1286 self = AppleTalk 1287 case String(kSecAttrProtocolAFP): 1288 self = AFP 1289 case String(kSecAttrProtocolTelnet): 1290 self = Telnet 1291 case String(kSecAttrProtocolSSH): 1292 self = SSH 1293 case String(kSecAttrProtocolFTPS): 1294 self = FTPS 1295 case String(kSecAttrProtocolHTTPS): 1296 self = HTTPS 1297 case String(kSecAttrProtocolHTTPProxy): 1298 self = HTTPProxy 1299 case String(kSecAttrProtocolHTTPSProxy): 1300 self = HTTPSProxy 1301 case String(kSecAttrProtocolFTPProxy): 1302 self = FTPProxy 1303 case String(kSecAttrProtocolSMB): 1304 self = SMB 1305 case String(kSecAttrProtocolRTSP): 1306 self = RTSP 1307 case String(kSecAttrProtocolRTSPProxy): 1308 self = RTSPProxy 1309 case String(kSecAttrProtocolDAAP): 1310 self = DAAP 1311 case String(kSecAttrProtocolEPPC): 1312 self = EPPC 1313 case String(kSecAttrProtocolIPP): 1314 self = IPP 1315 case String(kSecAttrProtocolNNTPS): 1316 self = NNTPS 1317 case String(kSecAttrProtocolLDAPS): 1318 self = LDAPS 1319 case String(kSecAttrProtocolTelnetS): 1320 self = TelnetS 1321 case String(kSecAttrProtocolIMAPS): 1322 self = IMAPS 1323 case String(kSecAttrProtocolIRCS): 1324 self = IRCS 1325 case String(kSecAttrProtocolPOP3S): 1326 self = POP3S 1327 default: 1328 return nil 1329 } 1330 } 1331 1332 public var rawValue
Keychain.swift:1161
            query[AttributeProtocol] = protocolType.rawValue
: String { 1333 switch self { 1334 case FTP: 1335 return String(kSecAttrProtocolFTP) 1336 case FTPAccount: 1337 return String(kSecAttrProtocolFTPAccount) 1338 case HTTP: 1339 return String(kSecAttrProtocolHTTP) 1340 case IRC: 1341 return String(kSecAttrProtocolIRC) 1342 case NNTP: 1343 return String(kSecAttrProtocolNNTP) 1344 case POP3: 1345 return String(kSecAttrProtocolPOP3) 1346 case SMTP: 1347 return String(kSecAttrProtocolSMTP) 1348 case SOCKS: 1349 return String(kSecAttrProtocolSOCKS) 1350 case IMAP: 1351 return String(kSecAttrProtocolIMAP) 1352 case LDAP: 1353 return String(kSecAttrProtocolLDAP) 1354 case AppleTalk: 1355 return String(kSecAttrProtocolAppleTalk) 1356 case AFP: 1357 return String(kSecAttrProtocolAFP) 1358 case Telnet: 1359 return String(kSecAttrProtocolTelnet) 1360 case SSH: 1361 return String(kSecAttrProtocolSSH) 1362 case FTPS: 1363 return String(kSecAttrProtocolFTPS) 1364 case HTTPS: 1365 return String(kSecAttrProtocolHTTPS) 1366 case HTTPProxy: 1367 return String(kSecAttrProtocolHTTPProxy) 1368 case HTTPSProxy: 1369 return String(kSecAttrProtocolHTTPSProxy) 1370 case FTPProxy: 1371 return String(kSecAttrProtocolFTPProxy) 1372 case SMB: 1373 return String(kSecAttrProtocolSMB) 1374 case RTSP: 1375 return String(kSecAttrProtocolRTSP) 1376 case RTSPProxy: 1377 return String(kSecAttrProtocolRTSPProxy) 1378 case DAAP: 1379 return String(kSecAttrProtocolDAAP) 1380 case EPPC: 1381 return String(kSecAttrProtocolEPPC) 1382 case IPP: 1383 return String(kSecAttrProtocolIPP) 1384 case NNTPS: 1385 return String(kSecAttrProtocolNNTPS) 1386 case LDAPS: 1387 return String(kSecAttrProtocolLDAPS) 1388 case TelnetS: 1389 return String(kSecAttrProtocolTelnetS) 1390 case IMAPS: 1391 return String(kSecAttrProtocolIMAPS) 1392 case IRCS: 1393 return String(kSecAttrProtocolIRCS) 1394 case POP3S: 1395 return String(kSecAttrProtocolPOP3S) 1396 } 1397 } 1398 1399 public var description
Keychain.swift:954
                        item["protocol"] = protocolType.description
: String { 1400 switch self { 1401 case FTP: 1402 return "FTP" 1403 case FTPAccount: 1404 return "FTPAccount" 1405 case HTTP: 1406 return "HTTP" 1407 case IRC: 1408 return "IRC" 1409 case NNTP: 1410 return "NNTP" 1411 case POP3: 1412 return "POP3" 1413 case SMTP: 1414 return "SMTP" 1415 case SOCKS: 1416 return "SOCKS" 1417 case IMAP: 1418 return "IMAP" 1419 case LDAP: 1420 return "LDAP" 1421 case AppleTalk: 1422 return "AppleTalk" 1423 case AFP: 1424 return "AFP" 1425 case Telnet: 1426 return "Telnet" 1427 case SSH: 1428 return "SSH" 1429 case FTPS: 1430 return "FTPS" 1431 case HTTPS: 1432 return "HTTPS" 1433 case HTTPProxy: 1434 return "HTTPProxy" 1435 case HTTPSProxy: 1436 return "HTTPSProxy" 1437 case FTPProxy: 1438 return "FTPProxy" 1439 case SMB: 1440 return "SMB" 1441 case RTSP: 1442 return "RTSP" 1443 case RTSPProxy: 1444 return "RTSPProxy" 1445 case DAAP: 1446 return "DAAP" 1447 case EPPC: 1448 return "EPPC" 1449 case IPP: 1450 return "IPP" 1451 case NNTPS: 1452 return "NNTPS" 1453 case LDAPS: 1454 return "LDAPS" 1455 case TelnetS: 1456 return "TelnetS" 1457 case IMAPS: 1458 return "IMAPS" 1459 case IRCS: 1460 return "IRCS" 1461 case POP3S: 1462 return "POP3S" 1463 } 1464 } 1465 } 1466 1467 extension AuthenticationType : RawRepresentable, CustomStringConvertible { 1468 1469 public init
Keychain.swift:958
                    if let authenticationType = AuthenticationType(rawValue: auth) {
?(rawValue: String) { 1470 switch rawValue { 1471 case String(kSecAttrAuthenticationTypeNTLM): 1472 self = NTLM 1473 case String(kSecAttrAuthenticationTypeMSN): 1474 self = MSN 1475 case String(kSecAttrAuthenticationTypeDPA): 1476 self = DPA 1477 case String(kSecAttrAuthenticationTypeRPA): 1478 self = RPA 1479 case String(kSecAttrAuthenticationTypeHTTPBasic): 1480 self = HTTPBasic 1481 case String(kSecAttrAuthenticationTypeHTTPDigest): 1482 self = HTTPDigest 1483 case String(kSecAttrAuthenticationTypeHTMLForm): 1484 self = HTMLForm 1485 case String(kSecAttrAuthenticationTypeDefault): 1486 self = Default 1487 default: 1488 return nil 1489 } 1490 } 1491 1492 public var rawValue
Keychain.swift:1162
            query[AttributeAuthenticationType] = authenticationType.rawValue
: String { 1493 switch self { 1494 case NTLM: 1495 return String(kSecAttrAuthenticationTypeNTLM) 1496 case MSN: 1497 return String(kSecAttrAuthenticationTypeMSN) 1498 case DPA: 1499 return String(kSecAttrAuthenticationTypeDPA) 1500 case RPA: 1501 return String(kSecAttrAuthenticationTypeRPA) 1502 case HTTPBasic: 1503 return String(kSecAttrAuthenticationTypeHTTPBasic) 1504 case HTTPDigest: 1505 return String(kSecAttrAuthenticationTypeHTTPDigest) 1506 case HTMLForm: 1507 return String(kSecAttrAuthenticationTypeHTMLForm) 1508 case Default: 1509 return String(kSecAttrAuthenticationTypeDefault) 1510 } 1511 } 1512 1513 public var description
Keychain.swift:959
                        item["authenticationType"] = authenticationType.description
: String { 1514 switch self { 1515 case NTLM: 1516 return "NTLM" 1517 case MSN: 1518 return "MSN" 1519 case DPA: 1520 return "DPA" 1521 case RPA: 1522 return "RPA" 1523 case HTTPBasic: 1524 return "HTTPBasic" 1525 case HTTPDigest: 1526 return "HTTPDigest" 1527 case HTMLForm: 1528 return "HTMLForm" 1529 case Default: 1530 return "Default" 1531 } 1532 } 1533 } 1534 1535 extension Accessibility : RawRepresentable, CustomStringConvertible { 1536 1537 public init
Keychain.swift:976
                if let accessibility = Accessibility(rawValue: accessible) {
?(rawValue: String) { 1538 if #available(OSX 10.10, *) { 1539 switch rawValue { 1540 case String(kSecAttrAccessibleWhenUnlocked): 1541 self = WhenUnlocked 1542 case String(kSecAttrAccessibleAfterFirstUnlock): 1543 self = AfterFirstUnlock 1544 case String(kSecAttrAccessibleAlways): 1545 self = Always 1546 case String(kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly): 1547 self = WhenPasscodeSetThisDeviceOnly 1548 case String(kSecAttrAccessibleWhenUnlockedThisDeviceOnly): 1549 self = WhenUnlockedThisDeviceOnly 1550 case String(kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly): 1551 self = AfterFirstUnlockThisDeviceOnly 1552 case String(kSecAttrAccessibleAlwaysThisDeviceOnly): 1553 self = AlwaysThisDeviceOnly 1554 default: 1555 return nil 1556 } 1557 } else { 1558 switch rawValue { 1559 case String(kSecAttrAccessibleWhenUnlocked): 1560 self = WhenUnlocked 1561 case String(kSecAttrAccessibleAfterFirstUnlock): 1562 self = AfterFirstUnlock 1563 case String(kSecAttrAccessibleAlways): 1564 self = Always 1565 case String(kSecAttrAccessibleWhenUnlockedThisDeviceOnly): 1566 self = WhenUnlockedThisDeviceOnly 1567 case String(kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly): 1568 self = AfterFirstUnlockThisDeviceOnly 1569 case String(kSecAttrAccessibleAlwaysThisDeviceOnly): 1570 self = AlwaysThisDeviceOnly 1571 default: 1572 return nil 1573 } 1574 } 1575 } 1576 1577 public var rawValue
Keychain.swift:1196
                guard let accessControl = SecAccessControlCreateWithFlags(kCFAllocatorDefault, accessibility.rawValue, SecAccessControlCreateFlags(rawValue: policy.rawValue), &error) else {
Keychain.swift:1208
            attributes[AttributeAccessible] = accessibility.rawValue
: String { 1578 switch self { 1579 case WhenUnlocked: 1580 return String(kSecAttrAccessibleWhenUnlocked) 1581 case AfterFirstUnlock: 1582 return String(kSecAttrAccessibleAfterFirstUnlock) 1583 case Always: 1584 return String(kSecAttrAccessibleAlways) 1585 case WhenPasscodeSetThisDeviceOnly: 1586 if #available(OSX 10.10, *) { 1587 return String(kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly) 1588 } else { 1589 fatalError("'Accessibility.WhenPasscodeSetThisDeviceOnly' is not available on this version of OS.") 1590 } 1591 case WhenUnlockedThisDeviceOnly: 1592 return String(kSecAttrAccessibleWhenUnlockedThisDeviceOnly) 1593 case AfterFirstUnlockThisDeviceOnly: 1594 return String(kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly) 1595 case AlwaysThisDeviceOnly: 1596 return String(kSecAttrAccessibleAlwaysThisDeviceOnly) 1597 } 1598 } 1599 1600 public var description
Keychain.swift:977
                    item["accessibility"] = accessibility.description
: String { 1601 switch self { 1602 case WhenUnlocked: 1603 return "WhenUnlocked" 1604 case AfterFirstUnlock: 1605 return "AfterFirstUnlock" 1606 case Always: 1607 return "Always" 1608 case WhenPasscodeSetThisDeviceOnly: 1609 return "WhenPasscodeSetThisDeviceOnly" 1610 case WhenUnlockedThisDeviceOnly: 1611 return "WhenUnlockedThisDeviceOnly" 1612 case AfterFirstUnlockThisDeviceOnly: 1613 return "AfterFirstUnlockThisDeviceOnly" 1614 case AlwaysThisDeviceOnly: 1615 return "AlwaysThisDeviceOnly" 1616 } 1617 } 1618 } 1619 1620 extension CFError { 1621 var error
Keychain.swift:1198
                        return (attributes, error.error)
: NSError { 1622 let domain = CFErrorGetDomain(self) as String 1623 let code = CFErrorGetCode(self) 1624 let userInfo = CFErrorCopyUserInfo(self) as [NSObject: AnyObject] 1625 1626 return NSError(domain: domain, code: code, userInfo: userInfo) 1627 } 1628 } 1629 1630 public enum Status
Keychain.swift:497
                throw Status.UnexpectedError
Keychain.swift:525
                throw Status.UnexpectedError
Keychain.swift:992
        let error = NSError(domain: KeychainAccessErrorDomain, code: Int(Status.ConversionError.rawValue), userInfo: [NSLocalizedDescriptionKey: message])
Keychain.swift:1003
        let message = Status(status: status).description
Keychain.swift:1200
                    let message = Status.UnexpectedError.description
Keychain.swift:1201
                    return (attributes, NSError(domain: KeychainAccessErrorDomain, code: Int(Status.UnexpectedError.rawValue), userInfo: [NSLocalizedDescriptionKey: message]))
Keychain.swift:2036
extension Status : RawRepresentable, CustomStringConvertible {
Keychain.swift:2039
        if let mappedStatus = Status(rawValue: status) {
: OSStatus, ErrorType { 1631 case Success
Keychain.swift:2048
        case Success:
= 0 1632 case Unimplemented
Keychain.swift:2050
        case Unimplemented:
= -4 1633 case DiskFull
Keychain.swift:2052
        case DiskFull:
= -34 1634 case IO
Keychain.swift:2054
        case IO:
= -36 1635 case OpWr
Keychain.swift:2056
        case OpWr:
= -49 1636 case Param
Keychain.swift:2058
        case Param:
= -50 1637 case WrPerm
Keychain.swift:2060
        case WrPerm:
= -61 1638 case Allocate
Keychain.swift:2062
        case Allocate:
= -108 1639 case UserCanceled
Keychain.swift:2064
        case UserCanceled:
= -128 1640 case BadReq
Keychain.swift:2066
        case BadReq:
= -909 1641 case InternalComponent
Keychain.swift:2068
        case InternalComponent:
= -2070 1642 case NotAvailable
Keychain.swift:2070
        case NotAvailable:
= -25291 1643 case ReadOnly
Keychain.swift:2072
        case ReadOnly:
= -25292 1644 case AuthFailed
Keychain.swift:2074
        case AuthFailed:
= -25293 1645 case NoSuchKeychain
Keychain.swift:2076
        case NoSuchKeychain:
= -25294 1646 case InvalidKeychain
Keychain.swift:2078
        case InvalidKeychain:
= -25295 1647 case DuplicateKeychain
Keychain.swift:2080
        case DuplicateKeychain:
= -25296 1648 case DuplicateCallback
Keychain.swift:2082
        case DuplicateCallback:
= -25297 1649 case InvalidCallback
Keychain.swift:2084
        case InvalidCallback:
= -25298 1650 case DuplicateItem
Keychain.swift:2086
        case DuplicateItem:
= -25299 1651 case ItemNotFound
Keychain.swift:2088
        case ItemNotFound:
= -25300 1652 case BufferTooSmall
Keychain.swift:2090
        case BufferTooSmall:
= -25301 1653 case DataTooLarge
Keychain.swift:2092
        case DataTooLarge:
= -25302 1654 case NoSuchAttr
Keychain.swift:2094
        case NoSuchAttr:
= -25303 1655 case InvalidItemRef
Keychain.swift:2096
        case InvalidItemRef:
= -25304 1656 case InvalidSearchRef
Keychain.swift:2098
        case InvalidSearchRef:
= -25305 1657 case NoSuchClass
Keychain.swift:2100
        case NoSuchClass:
= -25306 1658 case NoDefaultKeychain
Keychain.swift:2102
        case NoDefaultKeychain:
= -25307 1659 case InteractionNotAllowed
Keychain.swift:2104
        case InteractionNotAllowed:
= -25308 1660 case ReadOnlyAttr
Keychain.swift:2106
        case ReadOnlyAttr:
= -25309 1661 case WrongSecVersion
Keychain.swift:2108
        case WrongSecVersion:
= -25310 1662 case KeySizeNotAllowed
Keychain.swift:2110
        case KeySizeNotAllowed:
= -25311 1663 case NoStorageModule
Keychain.swift:2112
        case NoStorageModule:
= -25312 1664 case NoCertificateModule
Keychain.swift:2114
        case NoCertificateModule:
= -25313 1665 case NoPolicyModule
Keychain.swift:2116
        case NoPolicyModule:
= -25314 1666 case InteractionRequired
Keychain.swift:2118
        case InteractionRequired:
= -25315 1667 case DataNotAvailable
Keychain.swift:2120
        case DataNotAvailable:
= -25316 1668 case DataNotModifiable
Keychain.swift:2122
        case DataNotModifiable:
= -25317 1669 case CreateChainFailed
Keychain.swift:2124
        case CreateChainFailed:
= -25318 1670 case InvalidPrefsDomain
Keychain.swift:2126
        case InvalidPrefsDomain:
= -25319 1671 case InDarkWake
Keychain.swift:2128
        case InDarkWake:
= -25320 1672 case ACLNotSimple
Keychain.swift:2130
        case ACLNotSimple:
= -25240 1673 case PolicyNotFound
Keychain.swift:2132
        case PolicyNotFound:
= -25241 1674 case InvalidTrustSetting
Keychain.swift:2134
        case InvalidTrustSetting:
= -25242 1675 case NoAccessForItem
Keychain.swift:2136
        case NoAccessForItem:
= -25243 1676 case InvalidOwnerEdit
Keychain.swift:2138
        case InvalidOwnerEdit:
= -25244 1677 case TrustNotAvailable
Keychain.swift:2140
        case TrustNotAvailable:
= -25245 1678 case UnsupportedFormat
Keychain.swift:2142
        case UnsupportedFormat:
= -25256 1679 case UnknownFormat
Keychain.swift:2144
        case UnknownFormat:
= -25257 1680 case KeyIsSensitive
Keychain.swift:2146
        case KeyIsSensitive:
= -25258 1681 case MultiplePrivKeys
Keychain.swift:2148
        case MultiplePrivKeys:
= -25259 1682 case PassphraseRequired
Keychain.swift:2150
        case PassphraseRequired:
= -25260 1683 case InvalidPasswordRef
Keychain.swift:2152
        case InvalidPasswordRef:
= -25261 1684 case InvalidTrustSettings
Keychain.swift:2154
        case InvalidTrustSettings:
= -25262 1685 case NoTrustSettings
Keychain.swift:2156
        case NoTrustSettings:
= -25263 1686 case Pkcs12VerifyFailure
Keychain.swift:2158
        case Pkcs12VerifyFailure:
= -25264 1687 case InvalidCertificate
Keychain.swift:2160
        case InvalidCertificate:
= -26265 1688 case NotSigner
Keychain.swift:2162
        case NotSigner:
= -26267 1689 case PolicyDenied
Keychain.swift:2164
        case PolicyDenied:
= -26270 1690 case InvalidKey
Keychain.swift:2166
        case InvalidKey:
= -26274 1691 case Decode
Keychain.swift:2168
        case Decode:
= -26275 1692 case Internal
Keychain.swift:2170
        case Internal:
= -26276 1693 case UnsupportedAlgorithm
Keychain.swift:2172
        case UnsupportedAlgorithm:
= -26268 1694 case UnsupportedOperation
Keychain.swift:2174
        case UnsupportedOperation:
= -26271 1695 case UnsupportedPadding
Keychain.swift:2176
        case UnsupportedPadding:
= -26273 1696 case ItemInvalidKey
Keychain.swift:2178
        case ItemInvalidKey:
= -34000 1697 case ItemInvalidKeyType
Keychain.swift:2180
        case ItemInvalidKeyType:
= -34001 1698 case ItemInvalidValue
Keychain.swift:2182
        case ItemInvalidValue:
= -34002 1699 case ItemClassMissing
Keychain.swift:2184
        case ItemClassMissing:
= -34003 1700 case ItemMatchUnsupported
Keychain.swift:2186
        case ItemMatchUnsupported:
= -34004 1701 case UseItemListUnsupported
Keychain.swift:2188
        case UseItemListUnsupported:
= -34005 1702 case UseKeychainUnsupported
Keychain.swift:2190
        case UseKeychainUnsupported:
= -34006 1703 case UseKeychainListUnsupported
Keychain.swift:2192
        case UseKeychainListUnsupported:
= -34007 1704 case ReturnDataUnsupported
Keychain.swift:2194
        case ReturnDataUnsupported:
= -34008 1705 case ReturnAttributesUnsupported
Keychain.swift:2196
        case ReturnAttributesUnsupported:
= -34009 1706 case ReturnRefUnsupported
Keychain.swift:2198
        case ReturnRefUnsupported:
= -34010 1707 case ReturnPersitentRefUnsupported
Keychain.swift:2200
        case ReturnPersitentRefUnsupported:
= -34011 1708 case ValueRefUnsupported
Keychain.swift:2202
        case ValueRefUnsupported:
= -34012 1709 case ValuePersistentRefUnsupported
Keychain.swift:2204
        case ValuePersistentRefUnsupported:
= -34013 1710 case ReturnMissingPointer
Keychain.swift:2206
        case ReturnMissingPointer:
= -34014 1711 case MatchLimitUnsupported
Keychain.swift:2208
        case MatchLimitUnsupported:
= -34015 1712 case ItemIllegalQuery
Keychain.swift:2210
        case ItemIllegalQuery:
= -34016 1713 case WaitForCallback
Keychain.swift:2212
        case WaitForCallback:
= -34017 1714 case MissingEntitlement
Keychain.swift:2214
        case MissingEntitlement:
= -34018 1715 case UpgradePending
Keychain.swift:2216
        case UpgradePending:
= -34019 1716 case MPSignatureInvalid
Keychain.swift:2218
        case MPSignatureInvalid:
= -25327 1717 case OTRTooOld
Keychain.swift:2220
        case OTRTooOld:
= -25328 1718 case OTRIDTooNew
Keychain.swift:2222
        case OTRIDTooNew:
= -25329 1719 case ServiceNotAvailable
Keychain.swift:2224
        case ServiceNotAvailable:
= -67585 1720 case InsufficientClientID
Keychain.swift:2226
        case InsufficientClientID:
= -67586 1721 case DeviceReset
Keychain.swift:2228
        case DeviceReset:
= -67587 1722 case DeviceFailed
Keychain.swift:2230
        case DeviceFailed:
= -67588 1723 case AppleAddAppACLSubject
Keychain.swift:2232
        case AppleAddAppACLSubject:
= -67589 1724 case ApplePublicKeyIncomplete
Keychain.swift:2234
        case ApplePublicKeyIncomplete:
= -67590 1725 case AppleSignatureMismatch
Keychain.swift:2236
        case AppleSignatureMismatch:
= -67591 1726 case AppleInvalidKeyStartDate
Keychain.swift:2238
        case AppleInvalidKeyStartDate:
= -67592 1727 case AppleInvalidKeyEndDate
Keychain.swift:2240
        case AppleInvalidKeyEndDate:
= -67593 1728 case ConversionError
Keychain.swift:992
        let error = NSError(domain: KeychainAccessErrorDomain, code: Int(Status.ConversionError.rawValue), userInfo: [NSLocalizedDescriptionKey: message])
Keychain.swift:2242
        case ConversionError:
= -67594 1729 case AppleSSLv2Rollback
Keychain.swift:2244
        case AppleSSLv2Rollback:
= -67595 1730 case QuotaExceeded
Keychain.swift:2246
        case QuotaExceeded:
= -67596 1731 case FileTooBig
Keychain.swift:2248
        case FileTooBig:
= -67597 1732 case InvalidDatabaseBlob
Keychain.swift:2250
        case InvalidDatabaseBlob:
= -67598 1733 case InvalidKeyBlob
Keychain.swift:2252
        case InvalidKeyBlob:
= -67599 1734 case IncompatibleDatabaseBlob
Keychain.swift:2254
        case IncompatibleDatabaseBlob:
= -67600 1735 case IncompatibleKeyBlob
Keychain.swift:2256
        case IncompatibleKeyBlob:
= -67601 1736 case HostNameMismatch
Keychain.swift:2258
        case HostNameMismatch:
= -67602 1737 case UnknownCriticalExtensionFlag
Keychain.swift:2260
        case UnknownCriticalExtensionFlag:
= -67603 1738 case NoBasicConstraints
Keychain.swift:2262
        case NoBasicConstraints:
= -67604 1739 case NoBasicConstraintsCA
Keychain.swift:2264
        case NoBasicConstraintsCA:
= -67605 1740 case InvalidAuthorityKeyID
Keychain.swift:2266
        case InvalidAuthorityKeyID:
= -67606 1741 case InvalidSubjectKeyID
Keychain.swift:2268
        case InvalidSubjectKeyID:
= -67607 1742 case InvalidKeyUsageForPolicy
Keychain.swift:2270
        case InvalidKeyUsageForPolicy:
= -67608 1743 case InvalidExtendedKeyUsage
Keychain.swift:2272
        case InvalidExtendedKeyUsage:
= -67609 1744 case InvalidIDLinkage
Keychain.swift:2274
        case InvalidIDLinkage:
= -67610 1745 case PathLengthConstraintExceeded
Keychain.swift:2276
        case PathLengthConstraintExceeded:
= -67611 1746 case InvalidRoot
Keychain.swift:2278
        case InvalidRoot:
= -67612 1747 case CRLExpired
Keychain.swift:2280
        case CRLExpired:
= -67613 1748 case CRLNotValidYet
Keychain.swift:2282
        case CRLNotValidYet:
= -67614 1749 case CRLNotFound
Keychain.swift:2284
        case CRLNotFound:
= -67615 1750 case CRLServerDown
Keychain.swift:2286
        case CRLServerDown:
= -67616 1751 case CRLBadURI
Keychain.swift:2288
        case CRLBadURI:
= -67617 1752 case UnknownCertExtension
Keychain.swift:2290
        case UnknownCertExtension:
= -67618 1753 case UnknownCRLExtension
Keychain.swift:2292
        case UnknownCRLExtension:
= -67619 1754 case CRLNotTrusted
Keychain.swift:2294
        case CRLNotTrusted:
= -67620 1755 case CRLPolicyFailed
Keychain.swift:2296
        case CRLPolicyFailed:
= -67621 1756 case IDPFailure
Keychain.swift:2298
        case IDPFailure:
= -67622 1757 case SMIMEEmailAddressesNotFound
Keychain.swift:2300
        case SMIMEEmailAddressesNotFound:
= -67623 1758 case SMIMEBadExtendedKeyUsage
Keychain.swift:2302
        case SMIMEBadExtendedKeyUsage:
= -67624 1759 case SMIMEBadKeyUsage
Keychain.swift:2304
        case SMIMEBadKeyUsage:
= -67625 1760 case SMIMEKeyUsageNotCritical
Keychain.swift:2306
        case SMIMEKeyUsageNotCritical:
= -67626 1761 case SMIMENoEmailAddress
Keychain.swift:2308
        case SMIMENoEmailAddress:
= -67627 1762 case SMIMESubjAltNameNotCritical
Keychain.swift:2310
        case SMIMESubjAltNameNotCritical:
= -67628 1763 case SSLBadExtendedKeyUsage
Keychain.swift:2312
        case SSLBadExtendedKeyUsage:
= -67629 1764 case OCSPBadResponse
Keychain.swift:2314
        case OCSPBadResponse:
= -67630 1765 case OCSPBadRequest
Keychain.swift:2316
        case OCSPBadRequest:
= -67631 1766 case OCSPUnavailable
Keychain.swift:2318
        case OCSPUnavailable:
= -67632 1767 case OCSPStatusUnrecognized
Keychain.swift:2320
        case OCSPStatusUnrecognized:
= -67633 1768 case EndOfData
Keychain.swift:2322
        case EndOfData:
= -67634 1769 case IncompleteCertRevocationCheck
Keychain.swift:2324
        case IncompleteCertRevocationCheck:
= -67635 1770 case NetworkFailure
Keychain.swift:2326
        case NetworkFailure:
= -67636 1771 case OCSPNotTrustedToAnchor
Keychain.swift:2328
        case OCSPNotTrustedToAnchor:
= -67637 1772 case RecordModified
Keychain.swift:2330
        case RecordModified:
= -67638 1773 case OCSPSignatureError
Keychain.swift:2332
        case OCSPSignatureError:
= -67639 1774 case OCSPNoSigner
Keychain.swift:2334
        case OCSPNoSigner:
= -67640 1775 case OCSPResponderMalformedReq
Keychain.swift:2336
        case OCSPResponderMalformedReq:
= -67641 1776 case OCSPResponderInternalError
Keychain.swift:2338
        case OCSPResponderInternalError:
= -67642 1777 case OCSPResponderTryLater
Keychain.swift:2340
        case OCSPResponderTryLater:
= -67643 1778 case OCSPResponderSignatureRequired
Keychain.swift:2342
        case OCSPResponderSignatureRequired:
= -67644 1779 case OCSPResponderUnauthorized
Keychain.swift:2344
        case OCSPResponderUnauthorized:
= -67645 1780 case OCSPResponseNonceMismatch
Keychain.swift:2346
        case OCSPResponseNonceMismatch:
= -67646 1781 case CodeSigningBadCertChainLength
Keychain.swift:2348
        case CodeSigningBadCertChainLength:
= -67647 1782 case CodeSigningNoBasicConstraints
Keychain.swift:2350
        case CodeSigningNoBasicConstraints:
= -67648 1783 case CodeSigningBadPathLengthConstraint
Keychain.swift:2352
        case CodeSigningBadPathLengthConstraint:
= -67649 1784 case CodeSigningNoExtendedKeyUsage
Keychain.swift:2354
        case CodeSigningNoExtendedKeyUsage:
= -67650 1785 case CodeSigningDevelopment
Keychain.swift:2356
        case CodeSigningDevelopment:
= -67651 1786 case ResourceSignBadCertChainLength
Keychain.swift:2358
        case ResourceSignBadCertChainLength:
= -67652 1787 case ResourceSignBadExtKeyUsage
Keychain.swift:2360
        case ResourceSignBadExtKeyUsage:
= -67653 1788 case TrustSettingDeny
Keychain.swift:2362
        case TrustSettingDeny:
= -67654 1789 case InvalidSubjectName
Keychain.swift:2364
        case InvalidSubjectName:
= -67655 1790 case UnknownQualifiedCertStatement
Keychain.swift:2366
        case UnknownQualifiedCertStatement:
= -67656 1791 case MobileMeRequestQueued
Keychain.swift:2368
        case MobileMeRequestQueued:
= -67657 1792 case MobileMeRequestRedirected
Keychain.swift:2370
        case MobileMeRequestRedirected:
= -67658 1793 case MobileMeServerError
Keychain.swift:2372
        case MobileMeServerError:
= -67659 1794 case MobileMeServerNotAvailable
Keychain.swift:2374
        case MobileMeServerNotAvailable:
= -67660 1795 case MobileMeServerAlreadyExists
Keychain.swift:2376
        case MobileMeServerAlreadyExists:
= -67661 1796 case MobileMeServerServiceErr
Keychain.swift:2378
        case MobileMeServerServiceErr:
= -67662 1797 case MobileMeRequestAlreadyPending
Keychain.swift:2380
        case MobileMeRequestAlreadyPending:
= -67663 1798 case MobileMeNoRequestPending
Keychain.swift:2382
        case MobileMeNoRequestPending:
= -67664 1799 case MobileMeCSRVerifyFailure
Keychain.swift:2384
        case MobileMeCSRVerifyFailure:
= -67665 1800 case MobileMeFailedConsistencyCheck
Keychain.swift:2386
        case MobileMeFailedConsistencyCheck:
= -67666 1801 case NotInitialized
Keychain.swift:2388
        case NotInitialized:
= -67667 1802 case InvalidHandleUsage
Keychain.swift:2390
        case InvalidHandleUsage:
= -67668 1803 case PVCReferentNotFound
Keychain.swift:2392
        case PVCReferentNotFound:
= -67669 1804 case FunctionIntegrityFail
Keychain.swift:2394
        case FunctionIntegrityFail:
= -67670 1805 case InternalError
Keychain.swift:2396
        case InternalError:
= -67671 1806 case MemoryError
Keychain.swift:2398
        case MemoryError:
= -67672 1807 case InvalidData
Keychain.swift:2400
        case InvalidData:
= -67673 1808 case MDSError
Keychain.swift:2402
        case MDSError:
= -67674 1809 case InvalidPointer
Keychain.swift:2404
        case InvalidPointer:
= -67675 1810 case SelfCheckFailed
Keychain.swift:2406
        case SelfCheckFailed:
= -67676 1811 case FunctionFailed
Keychain.swift:2408
        case FunctionFailed:
= -67677 1812 case ModuleManifestVerifyFailed
Keychain.swift:2410
        case ModuleManifestVerifyFailed:
= -67678 1813 case InvalidGUID
Keychain.swift:2412
        case InvalidGUID:
= -67679 1814 case InvalidHandle
Keychain.swift:2414
        case InvalidHandle:
= -67680 1815 case InvalidDBList
Keychain.swift:2416
        case InvalidDBList:
= -67681 1816 case InvalidPassthroughID
Keychain.swift:2418
        case InvalidPassthroughID:
= -67682 1817 case InvalidNetworkAddress
Keychain.swift:2420
        case InvalidNetworkAddress:
= -67683 1818 case CRLAlreadySigned
Keychain.swift:2422
        case CRLAlreadySigned:
= -67684 1819 case InvalidNumberOfFields
Keychain.swift:2424
        case InvalidNumberOfFields:
= -67685 1820 case VerificationFailure
Keychain.swift:2426
        case VerificationFailure:
= -67686 1821 case UnknownTag
Keychain.swift:2428
        case UnknownTag:
= -67687 1822 case InvalidSignature
Keychain.swift:2430
        case InvalidSignature:
= -67688 1823 case InvalidName
Keychain.swift:2432
        case InvalidName:
= -67689 1824 case InvalidCertificateRef
Keychain.swift:2434
        case InvalidCertificateRef:
= -67690 1825 case InvalidCertificateGroup
Keychain.swift:2436
        case InvalidCertificateGroup:
= -67691 1826 case TagNotFound
Keychain.swift:2438
        case TagNotFound:
= -67692 1827 case InvalidQuery
Keychain.swift:2440
        case InvalidQuery:
= -67693 1828 case InvalidValue
Keychain.swift:2442
        case InvalidValue:
= -67694 1829 case CallbackFailed
Keychain.swift:2444
        case CallbackFailed:
= -67695 1830 case ACLDeleteFailed
Keychain.swift:2446
        case ACLDeleteFailed:
= -67696 1831 case ACLReplaceFailed
Keychain.swift:2448
        case ACLReplaceFailed:
= -67697 1832 case ACLAddFailed
Keychain.swift:2450
        case ACLAddFailed:
= -67698 1833 case ACLChangeFailed
Keychain.swift:2452
        case ACLChangeFailed:
= -67699 1834 case InvalidAccessCredentials
Keychain.swift:2454
        case InvalidAccessCredentials:
= -67700 1835 case InvalidRecord
Keychain.swift:2456
        case InvalidRecord:
= -67701 1836 case InvalidACL
Keychain.swift:2458
        case InvalidACL:
= -67702 1837 case InvalidSampleValue
Keychain.swift:2460
        case InvalidSampleValue:
= -67703 1838 case IncompatibleVersion
Keychain.swift:2462
        case IncompatibleVersion:
= -67704 1839 case PrivilegeNotGranted
Keychain.swift:2464
        case PrivilegeNotGranted:
= -67705 1840 case InvalidScope
Keychain.swift:2466
        case InvalidScope:
= -67706 1841 case PVCAlreadyConfigured
Keychain.swift:2468
        case PVCAlreadyConfigured:
= -67707 1842 case InvalidPVC
Keychain.swift:2470
        case InvalidPVC:
= -67708 1843 case EMMLoadFailed
Keychain.swift:2472
        case EMMLoadFailed:
= -67709 1844 case EMMUnloadFailed
Keychain.swift:2474
        case EMMUnloadFailed:
= -67710 1845 case AddinLoadFailed
Keychain.swift:2476
        case AddinLoadFailed:
= -67711 1846 case InvalidKeyRef
Keychain.swift:2478
        case InvalidKeyRef:
= -67712 1847 case InvalidKeyHierarchy
Keychain.swift:2480
        case InvalidKeyHierarchy:
= -67713 1848 case AddinUnloadFailed
Keychain.swift:2482
        case AddinUnloadFailed:
= -67714 1849 case LibraryReferenceNotFound
Keychain.swift:2484
        case LibraryReferenceNotFound:
= -67715 1850 case InvalidAddinFunctionTable
Keychain.swift:2486
        case InvalidAddinFunctionTable:
= -67716 1851 case InvalidServiceMask
Keychain.swift:2488
        case InvalidServiceMask:
= -67717 1852 case ModuleNotLoaded
Keychain.swift:2490
        case ModuleNotLoaded:
= -67718 1853 case InvalidSubServiceID
Keychain.swift:2492
        case InvalidSubServiceID:
= -67719 1854 case AttributeNotInContext
Keychain.swift:2494
        case AttributeNotInContext:
= -67720 1855 case ModuleManagerInitializeFailed
Keychain.swift:2496
        case ModuleManagerInitializeFailed:
= -67721 1856 case ModuleManagerNotFound
Keychain.swift:2498
        case ModuleManagerNotFound:
= -67722 1857 case EventNotificationCallbackNotFound
Keychain.swift:2500
        case EventNotificationCallbackNotFound:
= -67723 1858 case InputLengthError
Keychain.swift:2502
        case InputLengthError:
= -67724 1859 case OutputLengthError
Keychain.swift:2504
        case OutputLengthError:
= -67725 1860 case PrivilegeNotSupported
Keychain.swift:2506
        case PrivilegeNotSupported:
= -67726 1861 case DeviceError
Keychain.swift:2508
        case DeviceError:
= -67727 1862 case AttachHandleBusy
Keychain.swift:2510
        case AttachHandleBusy:
= -67728 1863 case NotLoggedIn
Keychain.swift:2512
        case NotLoggedIn:
= -67729 1864 case AlgorithmMismatch
Keychain.swift:2514
        case AlgorithmMismatch:
= -67730 1865 case KeyUsageIncorrect
Keychain.swift:2516
        case KeyUsageIncorrect:
= -67731 1866 case KeyBlobTypeIncorrect
Keychain.swift:2518
        case KeyBlobTypeIncorrect:
= -67732 1867 case KeyHeaderInconsistent
Keychain.swift:2520
        case KeyHeaderInconsistent:
= -67733 1868 case UnsupportedKeyFormat
Keychain.swift:2522
        case UnsupportedKeyFormat:
= -67734 1869 case UnsupportedKeySize
Keychain.swift:2524
        case UnsupportedKeySize:
= -67735 1870 case InvalidKeyUsageMask
Keychain.swift:2526
        case InvalidKeyUsageMask:
= -67736 1871 case UnsupportedKeyUsageMask
Keychain.swift:2528
        case UnsupportedKeyUsageMask:
= -67737 1872 case InvalidKeyAttributeMask
Keychain.swift:2530
        case InvalidKeyAttributeMask:
= -67738 1873 case UnsupportedKeyAttributeMask
Keychain.swift:2532
        case UnsupportedKeyAttributeMask:
= -67739 1874 case InvalidKeyLabel
Keychain.swift:2534
        case InvalidKeyLabel:
= -67740 1875 case UnsupportedKeyLabel
Keychain.swift:2536
        case UnsupportedKeyLabel:
= -67741 1876 case InvalidKeyFormat
Keychain.swift:2538
        case InvalidKeyFormat:
= -67742 1877 case UnsupportedVectorOfBuffers
Keychain.swift:2540
        case UnsupportedVectorOfBuffers:
= -67743 1878 case InvalidInputVector
Keychain.swift:2542
        case InvalidInputVector:
= -67744 1879 case InvalidOutputVector
Keychain.swift:2544
        case InvalidOutputVector:
= -67745 1880 case InvalidContext
Keychain.swift:2546
        case InvalidContext:
= -67746 1881 case InvalidAlgorithm
Keychain.swift:2548
        case InvalidAlgorithm:
= -67747 1882 case InvalidAttributeKey
Keychain.swift:2550
        case InvalidAttributeKey:
= -67748 1883 case MissingAttributeKey
Keychain.swift:2552
        case MissingAttributeKey:
= -67749 1884 case InvalidAttributeInitVector
Keychain.swift:2554
        case InvalidAttributeInitVector:
= -67750 1885 case MissingAttributeInitVector
Keychain.swift:2556
        case MissingAttributeInitVector:
= -67751 1886 case InvalidAttributeSalt
Keychain.swift:2558
        case InvalidAttributeSalt:
= -67752 1887 case MissingAttributeSalt
Keychain.swift:2560
        case MissingAttributeSalt:
= -67753 1888 case InvalidAttributePadding
Keychain.swift:2562
        case InvalidAttributePadding:
= -67754 1889 case MissingAttributePadding
Keychain.swift:2564
        case MissingAttributePadding:
= -67755 1890 case InvalidAttributeRandom
Keychain.swift:2566
        case InvalidAttributeRandom:
= -67756 1891 case MissingAttributeRandom
Keychain.swift:2568
        case MissingAttributeRandom:
= -67757 1892 case InvalidAttributeSeed
Keychain.swift:2570
        case InvalidAttributeSeed:
= -67758 1893 case MissingAttributeSeed
Keychain.swift:2572
        case MissingAttributeSeed:
= -67759 1894 case InvalidAttributePassphrase
Keychain.swift:2574
        case InvalidAttributePassphrase:
= -67760 1895 case MissingAttributePassphrase
Keychain.swift:2576
        case MissingAttributePassphrase:
= -67761 1896 case InvalidAttributeKeyLength
Keychain.swift:2578
        case InvalidAttributeKeyLength:
= -67762 1897 case MissingAttributeKeyLength
Keychain.swift:2580
        case MissingAttributeKeyLength:
= -67763 1898 case InvalidAttributeBlockSize
Keychain.swift:2582
        case InvalidAttributeBlockSize:
= -67764 1899 case MissingAttributeBlockSize
Keychain.swift:2584
        case MissingAttributeBlockSize:
= -67765 1900 case InvalidAttributeOutputSize
Keychain.swift:2586
        case InvalidAttributeOutputSize:
= -67766 1901 case MissingAttributeOutputSize
Keychain.swift:2588
        case MissingAttributeOutputSize:
= -67767 1902 case InvalidAttributeRounds
Keychain.swift:2590
        case InvalidAttributeRounds:
= -67768 1903 case MissingAttributeRounds
Keychain.swift:2592
        case MissingAttributeRounds:
= -67769 1904 case InvalidAlgorithmParms
Keychain.swift:2594
        case InvalidAlgorithmParms:
= -67770 1905 case MissingAlgorithmParms
Keychain.swift:2596
        case MissingAlgorithmParms:
= -67771 1906 case InvalidAttributeLabel
Keychain.swift:2598
        case InvalidAttributeLabel:
= -67772 1907 case MissingAttributeLabel
Keychain.swift:2600
        case MissingAttributeLabel:
= -67773 1908 case InvalidAttributeKeyType
Keychain.swift:2602
        case InvalidAttributeKeyType:
= -67774 1909 case MissingAttributeKeyType
Keychain.swift:2604
        case MissingAttributeKeyType:
= -67775 1910 case InvalidAttributeMode
Keychain.swift:2606
        case InvalidAttributeMode:
= -67776 1911 case MissingAttributeMode
Keychain.swift:2608
        case MissingAttributeMode:
= -67777 1912 case InvalidAttributeEffectiveBits
Keychain.swift:2610
        case InvalidAttributeEffectiveBits:
= -67778 1913 case MissingAttributeEffectiveBits
Keychain.swift:2612
        case MissingAttributeEffectiveBits:
= -67779 1914 case InvalidAttributeStartDate
Keychain.swift:2614
        case InvalidAttributeStartDate:
= -67780 1915 case MissingAttributeStartDate
Keychain.swift:2616
        case MissingAttributeStartDate:
= -67781 1916 case InvalidAttributeEndDate
Keychain.swift:2618
        case InvalidAttributeEndDate:
= -67782 1917 case MissingAttributeEndDate
Keychain.swift:2620
        case MissingAttributeEndDate:
= -67783 1918 case InvalidAttributeVersion
Keychain.swift:2622
        case InvalidAttributeVersion:
= -67784 1919 case MissingAttributeVersion
Keychain.swift:2624
        case MissingAttributeVersion:
= -67785 1920 case InvalidAttributePrime
Keychain.swift:2626
        case InvalidAttributePrime:
= -67786 1921 case MissingAttributePrime
Keychain.swift:2628
        case MissingAttributePrime:
= -67787 1922 case InvalidAttributeBase
Keychain.swift:2630
        case InvalidAttributeBase:
= -67788 1923 case MissingAttributeBase
Keychain.swift:2632
        case MissingAttributeBase:
= -67789 1924 case InvalidAttributeSubprime
Keychain.swift:2634
        case InvalidAttributeSubprime:
= -67790 1925 case MissingAttributeSubprime
Keychain.swift:2636
        case MissingAttributeSubprime:
= -67791 1926 case InvalidAttributeIterationCount
Keychain.swift:2638
        case InvalidAttributeIterationCount:
= -67792 1927 case MissingAttributeIterationCount
Keychain.swift:2640
        case MissingAttributeIterationCount:
= -67793 1928 case InvalidAttributeDLDBHandle
Keychain.swift:2642
        case InvalidAttributeDLDBHandle:
= -67794 1929 case MissingAttributeDLDBHandle
Keychain.swift:2644
        case MissingAttributeDLDBHandle:
= -67795 1930 case InvalidAttributeAccessCredentials
Keychain.swift:2646
        case InvalidAttributeAccessCredentials:
= -67796 1931 case MissingAttributeAccessCredentials
Keychain.swift:2648
        case MissingAttributeAccessCredentials:
= -67797 1932 case InvalidAttributePublicKeyFormat
Keychain.swift:2650
        case InvalidAttributePublicKeyFormat:
= -67798 1933 case MissingAttributePublicKeyFormat
Keychain.swift:2652
        case MissingAttributePublicKeyFormat:
= -67799 1934 case InvalidAttributePrivateKeyFormat
Keychain.swift:2654
        case InvalidAttributePrivateKeyFormat:
= -67800 1935 case MissingAttributePrivateKeyFormat
Keychain.swift:2656
        case MissingAttributePrivateKeyFormat:
= -67801 1936 case InvalidAttributeSymmetricKeyFormat
Keychain.swift:2658
        case InvalidAttributeSymmetricKeyFormat:
= -67802 1937 case MissingAttributeSymmetricKeyFormat
Keychain.swift:2660
        case MissingAttributeSymmetricKeyFormat:
= -67803 1938 case InvalidAttributeWrappedKeyFormat
Keychain.swift:2662
        case InvalidAttributeWrappedKeyFormat:
= -67804 1939 case MissingAttributeWrappedKeyFormat
Keychain.swift:2664
        case MissingAttributeWrappedKeyFormat:
= -67805 1940 case StagedOperationInProgress
Keychain.swift:2666
        case StagedOperationInProgress:
= -67806 1941 case StagedOperationNotStarted
Keychain.swift:2668
        case StagedOperationNotStarted:
= -67807 1942 case VerifyFailed
Keychain.swift:2670
        case VerifyFailed:
= -67808 1943 case QuerySizeUnknown
Keychain.swift:2672
        case QuerySizeUnknown:
= -67809 1944 case BlockSizeMismatch
Keychain.swift:2674
        case BlockSizeMismatch:
= -67810 1945 case PublicKeyInconsistent
Keychain.swift:2676
        case PublicKeyInconsistent:
= -67811 1946 case DeviceVerifyFailed
Keychain.swift:2678
        case DeviceVerifyFailed:
= -67812 1947 case InvalidLoginName
Keychain.swift:2680
        case InvalidLoginName:
= -67813 1948 case AlreadyLoggedIn
Keychain.swift:2682
        case AlreadyLoggedIn:
= -67814 1949 case InvalidDigestAlgorithm
Keychain.swift:2684
        case InvalidDigestAlgorithm:
= -67815 1950 case InvalidCRLGroup
Keychain.swift:2686
        case InvalidCRLGroup:
= -67816 1951 case CertificateCannotOperate
Keychain.swift:2688
        case CertificateCannotOperate:
= -67817 1952 case CertificateExpired
Keychain.swift:2690
        case CertificateExpired:
= -67818 1953 case CertificateNotValidYet
Keychain.swift:2692
        case CertificateNotValidYet:
= -67819 1954 case CertificateRevoked
Keychain.swift:2694
        case CertificateRevoked:
= -67820 1955 case CertificateSuspended
Keychain.swift:2696
        case CertificateSuspended:
= -67821 1956 case InsufficientCredentials
Keychain.swift:2698
        case InsufficientCredentials:
= -67822 1957 case InvalidAction
Keychain.swift:2700
        case InvalidAction:
= -67823 1958 case InvalidAuthority
Keychain.swift:2702
        case InvalidAuthority:
= -67824 1959 case VerifyActionFailed
Keychain.swift:2704
        case VerifyActionFailed:
= -67825 1960 case InvalidCertAuthority
Keychain.swift:2706
        case InvalidCertAuthority:
= -67826 1961 case InvaldCRLAuthority
Keychain.swift:2708
        case InvaldCRLAuthority:
= -67827 1962 case InvalidCRLEncoding
Keychain.swift:2710
        case InvalidCRLEncoding:
= -67828 1963 case InvalidCRLType
Keychain.swift:2712
        case InvalidCRLType:
= -67829 1964 case InvalidCRL
Keychain.swift:2714
        case InvalidCRL:
= -67830 1965 case InvalidFormType
Keychain.swift:2716
        case InvalidFormType:
= -67831 1966 case InvalidID
Keychain.swift:2718
        case InvalidID:
= -67832 1967 case InvalidIdentifier
Keychain.swift:2720
        case InvalidIdentifier:
= -67833 1968 case InvalidIndex
Keychain.swift:2722
        case InvalidIndex:
= -67834 1969 case InvalidPolicyIdentifiers
Keychain.swift:2724
        case InvalidPolicyIdentifiers:
= -67835 1970 case InvalidTimeString
Keychain.swift:2726
        case InvalidTimeString:
= -67836 1971 case InvalidReason
Keychain.swift:2728
        case InvalidReason:
= -67837 1972 case InvalidRequestInputs
Keychain.swift:2730
        case InvalidRequestInputs:
= -67838 1973 case InvalidResponseVector
Keychain.swift:2732
        case InvalidResponseVector:
= -67839 1974 case InvalidStopOnPolicy
Keychain.swift:2734
        case InvalidStopOnPolicy:
= -67840 1975 case InvalidTuple
Keychain.swift:2736
        case InvalidTuple:
= -67841 1976 case MultipleValuesUnsupported
Keychain.swift:2738
        case MultipleValuesUnsupported:
= -67842 1977 case NotTrusted
Keychain.swift:2740
        case NotTrusted:
= -67843 1978 case NoDefaultAuthority
Keychain.swift:2742
        case NoDefaultAuthority:
= -67844 1979 case RejectedForm
Keychain.swift:2744
        case RejectedForm:
= -67845 1980 case RequestLost
Keychain.swift:2746
        case RequestLost:
= -67846 1981 case RequestRejected
Keychain.swift:2748
        case RequestRejected:
= -67847 1982 case UnsupportedAddressType
Keychain.swift:2750
        case UnsupportedAddressType:
= -67848 1983 case UnsupportedService
Keychain.swift:2752
        case UnsupportedService:
= -67849 1984 case InvalidTupleGroup
Keychain.swift:2754
        case InvalidTupleGroup:
= -67850 1985 case InvalidBaseACLs
Keychain.swift:2756
        case InvalidBaseACLs:
= -67851 1986 case InvalidTupleCredendtials
Keychain.swift:2758
        case InvalidTupleCredendtials:
= -67852 1987 case InvalidEncoding
Keychain.swift:2760
        case InvalidEncoding:
= -67853 1988 case InvalidValidityPeriod
Keychain.swift:2762
        case InvalidValidityPeriod:
= -67854 1989 case InvalidRequestor
Keychain.swift:2764
        case InvalidRequestor:
= -67855 1990 case RequestDescriptor
Keychain.swift:2766
        case RequestDescriptor:
= -67856 1991 case InvalidBundleInfo
Keychain.swift:2768
        case InvalidBundleInfo:
= -67857 1992 case InvalidCRLIndex
Keychain.swift:2770
        case InvalidCRLIndex:
= -67858 1993 case NoFieldValues
Keychain.swift:2772
        case NoFieldValues:
= -67859 1994 case UnsupportedFieldFormat
Keychain.swift:2774
        case UnsupportedFieldFormat:
= -67860 1995 case UnsupportedIndexInfo
Keychain.swift:2776
        case UnsupportedIndexInfo:
= -67861 1996 case UnsupportedLocality
Keychain.swift:2778
        case UnsupportedLocality:
= -67862 1997 case UnsupportedNumAttributes
Keychain.swift:2780
        case UnsupportedNumAttributes:
= -67863 1998 case UnsupportedNumIndexes
Keychain.swift:2782
        case UnsupportedNumIndexes:
= -67864 1999 case UnsupportedNumRecordTypes
Keychain.swift:2784
        case UnsupportedNumRecordTypes:
= -67865 2000 case FieldSpecifiedMultiple
Keychain.swift:2786
        case FieldSpecifiedMultiple:
= -67866 2001 case IncompatibleFieldFormat
Keychain.swift:2788
        case IncompatibleFieldFormat:
= -67867 2002 case InvalidParsingModule
Keychain.swift:2790
        case InvalidParsingModule:
= -67868 2003 case DatabaseLocked
Keychain.swift:2792
        case DatabaseLocked:
= -67869 2004 case DatastoreIsOpen
Keychain.swift:2794
        case DatastoreIsOpen:
= -67870 2005 case MissingValue
Keychain.swift:2796
        case MissingValue:
= -67871 2006 case UnsupportedQueryLimits
Keychain.swift:2798
        case UnsupportedQueryLimits:
= -67872 2007 case UnsupportedNumSelectionPreds
Keychain.swift:2800
        case UnsupportedNumSelectionPreds:
= -67873 2008 case UnsupportedOperator
Keychain.swift:2802
        case UnsupportedOperator:
= -67874 2009 case InvalidDBLocation
Keychain.swift:2804
        case InvalidDBLocation:
= -67875 2010 case InvalidAccessRequest
Keychain.swift:2806
        case InvalidAccessRequest:
= -67876 2011 case InvalidIndexInfo
Keychain.swift:2808
        case InvalidIndexInfo:
= -67877 2012 case InvalidNewOwner
Keychain.swift:2810
        case InvalidNewOwner:
= -67878 2013 case InvalidModifyMode
Keychain.swift:2812
        case InvalidModifyMode:
= -67879 2014 case MissingRequiredExtension
Keychain.swift:2814
        case MissingRequiredExtension:
= -67880 2015 case ExtendedKeyUsageNotCritical
Keychain.swift:2816
        case ExtendedKeyUsageNotCritical:
= -67881 2016 case TimestampMissing
Keychain.swift:2818
        case TimestampMissing:
= -67882 2017 case TimestampInvalid
Keychain.swift:2820
        case TimestampInvalid:
= -67883 2018 case TimestampNotTrusted
Keychain.swift:2822
        case TimestampNotTrusted:
= -67884 2019 case TimestampServiceNotAvailable
Keychain.swift:2824
        case TimestampServiceNotAvailable:
= -67885 2020 case TimestampBadAlg
Keychain.swift:2826
        case TimestampBadAlg:
= -67886 2021 case TimestampBadRequest
Keychain.swift:2828
        case TimestampBadRequest:
= -67887 2022 case TimestampBadDataFormat
Keychain.swift:2830
        case TimestampBadDataFormat:
= -67888 2023 case TimestampTimeNotAvailable
Keychain.swift:2832
        case TimestampTimeNotAvailable:
= -67889 2024 case TimestampUnacceptedPolicy
Keychain.swift:2834
        case TimestampUnacceptedPolicy:
= -67890 2025 case TimestampUnacceptedExtension
Keychain.swift:2836
        case TimestampUnacceptedExtension:
= -67891 2026 case TimestampAddInfoNotAvailable
Keychain.swift:2838
        case TimestampAddInfoNotAvailable:
= -67892 2027 case TimestampSystemFailure
Keychain.swift:2840
        case TimestampSystemFailure:
= -67893 2028 case SigningTimeMissing
Keychain.swift:2842
        case SigningTimeMissing:
= -67894 2029 case TimestampRejection
Keychain.swift:2844
        case TimestampRejection:
= -67895 2030 case TimestampWaiting
Keychain.swift:2846
        case TimestampWaiting:
= -67896 2031 case TimestampRevocationWarning
Keychain.swift:2848
        case TimestampRevocationWarning:
= -67897 2032 case TimestampRevocationNotification
Keychain.swift:2850
        case TimestampRevocationNotification:
= -67898 2033 case UnexpectedError
Keychain.swift:497
                throw Status.UnexpectedError
Keychain.swift:525
                throw Status.UnexpectedError
Keychain.swift:1200
                    let message = Status.UnexpectedError.description
Keychain.swift:1201
                    return (attributes, NSError(domain: KeychainAccessErrorDomain, code: Int(Status.UnexpectedError.rawValue), userInfo: [NSLocalizedDescriptionKey: message]))
Keychain.swift:2042
            self = .UnexpectedError
Keychain.swift:2852
        case UnexpectedError:
= -99999 2034 } 2035 2036 extension Status : RawRepresentable, CustomStringConvertible { 2037 2038 public init
Keychain.swift:1003
        let message = Status(status: status).description
(status: OSStatus) { 2039 if let mappedStatus = Status(rawValue: status) { 2040 self = mappedStatus 2041 } else { 2042 self = .UnexpectedError 2043 } 2044 } 2045 2046 public var description
Keychain.swift:1003
        let message = Status(status: status).description
Keychain.swift:1200
                    let message = Status.UnexpectedError.description
: String { 2047 switch self { 2048 case Success: 2049 return "No error." 2050 case Unimplemented: 2051 return "Function or operation not implemented." 2052 case DiskFull: 2053 return "The disk is full." 2054 case IO: 2055 return "I/O error (bummers)" 2056 case OpWr: 2057 return "file already open with with write permission" 2058 case Param: 2059 return "One or more parameters passed to a function were not valid." 2060 case WrPerm: 2061 return "write permissions error" 2062 case Allocate: 2063 return "Failed to allocate memory." 2064 case UserCanceled: 2065 return "User canceled the operation." 2066 case BadReq: 2067 return "Bad parameter or invalid state for operation." 2068 case InternalComponent: 2069 return "" 2070 case NotAvailable: 2071 return "No keychain is available. You may need to restart your computer." 2072 case ReadOnly: 2073 return "This keychain cannot be modified." 2074 case AuthFailed: 2075 return "The user name or passphrase you entered is not correct." 2076 case NoSuchKeychain: 2077 return "The specified keychain could not be found." 2078 case InvalidKeychain: 2079 return "The specified keychain is not a valid keychain file." 2080 case DuplicateKeychain: 2081 return "A keychain with the same name already exists." 2082 case DuplicateCallback: 2083 return "The specified callback function is already installed." 2084 case InvalidCallback: 2085 return "The specified callback function is not valid." 2086 case DuplicateItem: 2087 return "The specified item already exists in the keychain." 2088 case ItemNotFound: 2089 return "The specified item could not be found in the keychain." 2090 case BufferTooSmall: 2091 return "There is not enough memory available to use the specified item." 2092 case DataTooLarge: 2093 return "This item contains information which is too large or in a format that cannot be displayed." 2094 case NoSuchAttr: 2095 return "The specified attribute does not exist." 2096 case InvalidItemRef: 2097 return "The specified item is no longer valid. It may have been deleted from the keychain." 2098 case InvalidSearchRef: 2099 return "Unable to search the current keychain." 2100 case NoSuchClass: 2101 return "The specified item does not appear to be a valid keychain item." 2102 case NoDefaultKeychain: 2103 return "A default keychain could not be found." 2104 case InteractionNotAllowed: 2105 return "User interaction is not allowed." 2106 case ReadOnlyAttr: 2107 return "The specified attribute could not be modified." 2108 case WrongSecVersion: 2109 return "This keychain was created by a different version of the system software and cannot be opened." 2110 case KeySizeNotAllowed: 2111 return "This item specifies a key size which is too large." 2112 case NoStorageModule: 2113 return "A required component (data storage module) could not be loaded. You may need to restart your computer." 2114 case NoCertificateModule: 2115 return "A required component (certificate module) could not be loaded. You may need to restart your computer." 2116 case NoPolicyModule: 2117 return "A required component (policy module) could not be loaded. You may need to restart your computer." 2118 case InteractionRequired: 2119 return "User interaction is required, but is currently not allowed." 2120 case DataNotAvailable: 2121 return "The contents of this item cannot be retrieved." 2122 case DataNotModifiable: 2123 return "The contents of this item cannot be modified." 2124 case CreateChainFailed: 2125 return "One or more certificates required to validate this certificate cannot be found." 2126 case InvalidPrefsDomain: 2127 return "The specified preferences domain is not valid." 2128 case InDarkWake: 2129 return "In dark wake, no UI possible" 2130 case ACLNotSimple: 2131 return "The specified access control list is not in standard (simple) form." 2132 case PolicyNotFound: 2133 return "The specified policy cannot be found." 2134 case InvalidTrustSetting: 2135 return "The specified trust setting is invalid." 2136 case NoAccessForItem: 2137 return "The specified item has no access control." 2138 case InvalidOwnerEdit: 2139 return "Invalid attempt to change the owner of this item." 2140 case TrustNotAvailable: 2141 return "No trust results are available." 2142 case UnsupportedFormat: 2143 return "Import/Export format unsupported." 2144 case UnknownFormat: 2145 return "Unknown format in import." 2146 case KeyIsSensitive: 2147 return "Key material must be wrapped for export." 2148 case MultiplePrivKeys: 2149 return "An attempt was made to import multiple private keys." 2150 case PassphraseRequired: 2151 return "Passphrase is required for import/export." 2152 case InvalidPasswordRef: 2153 return "The password reference was invalid." 2154 case InvalidTrustSettings: 2155 return "The Trust Settings Record was corrupted." 2156 case NoTrustSettings: 2157 return "No Trust Settings were found." 2158 case Pkcs12VerifyFailure: 2159 return "MAC verification failed during PKCS12 import (wrong password?)" 2160 case InvalidCertificate: 2161 return "This certificate could not be decoded." 2162 case NotSigner: 2163 return "A certificate was not signed by its proposed parent." 2164 case PolicyDenied: 2165 return "The certificate chain was not trusted due to a policy not accepting it." 2166 case InvalidKey: 2167 return "The provided key material was not valid." 2168 case Decode: 2169 return "Unable to decode the provided data." 2170 case Internal: 2171 return "An internal error occurred in the Security framework." 2172 case UnsupportedAlgorithm: 2173 return "An unsupported algorithm was encountered." 2174 case UnsupportedOperation: 2175 return "The operation you requested is not supported by this key." 2176 case UnsupportedPadding: 2177 return "The padding you requested is not supported." 2178 case ItemInvalidKey: 2179 return "A string key in dictionary is not one of the supported keys." 2180 case ItemInvalidKeyType: 2181 return "A key in a dictionary is neither a CFStringRef nor a CFNumberRef." 2182 case ItemInvalidValue: 2183 return "A value in a dictionary is an invalid (or unsupported) CF type." 2184 case ItemClassMissing: 2185 return "No kSecItemClass key was specified in a dictionary." 2186 case ItemMatchUnsupported: 2187 return "The caller passed one or more kSecMatch keys to a function which does not support matches." 2188 case UseItemListUnsupported: 2189 return "The caller passed in a kSecUseItemList key to a function which does not support it." 2190 case UseKeychainUnsupported: 2191 return "The caller passed in a kSecUseKeychain key to a function which does not support it." 2192 case UseKeychainListUnsupported: 2193 return "The caller passed in a kSecUseKeychainList key to a function which does not support it." 2194 case ReturnDataUnsupported: 2195 return "The caller passed in a kSecReturnData key to a function which does not support it." 2196 case ReturnAttributesUnsupported: 2197 return "The caller passed in a kSecReturnAttributes key to a function which does not support it." 2198 case ReturnRefUnsupported: 2199 return "The caller passed in a kSecReturnRef key to a function which does not support it." 2200 case ReturnPersitentRefUnsupported: 2201 return "The caller passed in a kSecReturnPersistentRef key to a function which does not support it." 2202 case ValueRefUnsupported: 2203 return "The caller passed in a kSecValueRef key to a function which does not support it." 2204 case ValuePersistentRefUnsupported: 2205 return "The caller passed in a kSecValuePersistentRef key to a function which does not support it." 2206 case ReturnMissingPointer: 2207 return "The caller passed asked for something to be returned but did not pass in a result pointer." 2208 case MatchLimitUnsupported: 2209 return "The caller passed in a kSecMatchLimit key to a call which does not support limits." 2210 case ItemIllegalQuery: 2211 return "The caller passed in a query which contained too many keys." 2212 case WaitForCallback: 2213 return "This operation is incomplete, until the callback is invoked (not an error)." 2214 case MissingEntitlement: 2215 return "Internal error when a required entitlement isn't present, client has neither application-identifier nor keychain-access-groups entitlements." 2216 case UpgradePending: 2217 return "Error returned if keychain database needs a schema migration but the device is locked, clients should wait for a device unlock notification and retry the command." 2218 case MPSignatureInvalid: 2219 return "Signature invalid on MP message" 2220 case OTRTooOld: 2221 return "Message is too old to use" 2222 case OTRIDTooNew: 2223 return "Key ID is too new to use! Message from the future?" 2224 case ServiceNotAvailable: 2225 return "The required service is not available." 2226 case InsufficientClientID: 2227 return "The client ID is not correct." 2228 case DeviceReset: 2229 return "A device reset has occurred." 2230 case DeviceFailed: 2231 return "A device failure has occurred." 2232 case AppleAddAppACLSubject: 2233 return "Adding an application ACL subject failed." 2234 case ApplePublicKeyIncomplete: 2235 return "The public key is incomplete." 2236 case AppleSignatureMismatch: 2237 return "A signature mismatch has occurred." 2238 case AppleInvalidKeyStartDate: 2239 return "The specified key has an invalid start date." 2240 case AppleInvalidKeyEndDate: 2241 return "The specified key has an invalid end date." 2242 case ConversionError: 2243 return "A conversion error has occurred." 2244 case AppleSSLv2Rollback: 2245 return "A SSLv2 rollback error has occurred." 2246 case QuotaExceeded: 2247 return "The quota was exceeded." 2248 case FileTooBig: 2249 return "The file is too big." 2250 case InvalidDatabaseBlob: 2251 return "The specified database has an invalid blob." 2252 case InvalidKeyBlob: 2253 return "The specified database has an invalid key blob." 2254 case IncompatibleDatabaseBlob: 2255 return "The specified database has an incompatible blob." 2256 case IncompatibleKeyBlob: 2257 return "The specified database has an incompatible key blob." 2258 case HostNameMismatch: 2259 return "A host name mismatch has occurred." 2260 case UnknownCriticalExtensionFlag: 2261 return "There is an unknown critical extension flag." 2262 case NoBasicConstraints: 2263 return "No basic constraints were found." 2264 case NoBasicConstraintsCA: 2265 return "No basic CA constraints were found." 2266 case InvalidAuthorityKeyID: 2267 return "The authority key ID is not valid." 2268 case InvalidSubjectKeyID: 2269 return "The subject key ID is not valid." 2270 case InvalidKeyUsageForPolicy: 2271 return "The key usage is not valid for the specified policy." 2272 case InvalidExtendedKeyUsage: 2273 return "The extended key usage is not valid." 2274 case InvalidIDLinkage: 2275 return "The ID linkage is not valid." 2276 case PathLengthConstraintExceeded: 2277 return "The path length constraint was exceeded." 2278 case InvalidRoot: 2279 return "The root or anchor certificate is not valid." 2280 case CRLExpired: 2281 return "The CRL has expired." 2282 case CRLNotValidYet: 2283 return "The CRL is not yet valid." 2284 case CRLNotFound: 2285 return "The CRL was not found." 2286 case CRLServerDown: 2287 return "The CRL server is down." 2288 case CRLBadURI: 2289 return "The CRL has a bad Uniform Resource Identifier." 2290 case UnknownCertExtension: 2291 return "An unknown certificate extension was encountered." 2292 case UnknownCRLExtension: 2293 return "An unknown CRL extension was encountered." 2294 case CRLNotTrusted: 2295 return "The CRL is not trusted." 2296 case CRLPolicyFailed: 2297 return "The CRL policy failed." 2298 case IDPFailure: 2299 return "The issuing distribution point was not valid." 2300 case SMIMEEmailAddressesNotFound: 2301 return "An email address mismatch was encountered." 2302 case SMIMEBadExtendedKeyUsage: 2303 return "The appropriate extended key usage for SMIME was not found." 2304 case SMIMEBadKeyUsage: 2305 return "The key usage is not compatible with SMIME." 2306 case SMIMEKeyUsageNotCritical: 2307 return "The key usage extension is not marked as critical." 2308 case SMIMENoEmailAddress: 2309 return "No email address was found in the certificate." 2310 case SMIMESubjAltNameNotCritical: 2311 return "The subject alternative name extension is not marked as critical." 2312 case SSLBadExtendedKeyUsage: 2313 return "The appropriate extended key usage for SSL was not found." 2314 case OCSPBadResponse: 2315 return "The OCSP response was incorrect or could not be parsed." 2316 case OCSPBadRequest: 2317 return "The OCSP request was incorrect or could not be parsed." 2318 case OCSPUnavailable: 2319 return "OCSP service is unavailable." 2320 case OCSPStatusUnrecognized: 2321 return "The OCSP server did not recognize this certificate." 2322 case EndOfData: 2323 return "An end-of-data was detected." 2324 case IncompleteCertRevocationCheck: 2325 return "An incomplete certificate revocation check occurred." 2326 case NetworkFailure: 2327 return "A network failure occurred." 2328 case OCSPNotTrustedToAnchor: 2329 return "The OCSP response was not trusted to a root or anchor certificate." 2330 case RecordModified: 2331 return "The record was modified." 2332 case OCSPSignatureError: 2333 return "The OCSP response had an invalid signature." 2334 case OCSPNoSigner: 2335 return "The OCSP response had no signer." 2336 case OCSPResponderMalformedReq: 2337 return "The OCSP responder was given a malformed request." 2338 case OCSPResponderInternalError: 2339 return "The OCSP responder encountered an internal error." 2340 case OCSPResponderTryLater: 2341 return "The OCSP responder is busy, try again later." 2342 case OCSPResponderSignatureRequired: 2343 return "The OCSP responder requires a signature." 2344 case OCSPResponderUnauthorized: 2345 return "The OCSP responder rejected this request as unauthorized." 2346 case OCSPResponseNonceMismatch: 2347 return "The OCSP response nonce did not match the request." 2348 case CodeSigningBadCertChainLength: 2349 return "Code signing encountered an incorrect certificate chain length." 2350 case CodeSigningNoBasicConstraints: 2351 return "Code signing found no basic constraints." 2352 case CodeSigningBadPathLengthConstraint: 2353 return "Code signing encountered an incorrect path length constraint." 2354 case CodeSigningNoExtendedKeyUsage: 2355 return "Code signing found no extended key usage." 2356 case CodeSigningDevelopment: 2357 return "Code signing indicated use of a development-only certificate." 2358 case ResourceSignBadCertChainLength: 2359 return "Resource signing has encountered an incorrect certificate chain length." 2360 case ResourceSignBadExtKeyUsage: 2361 return "Resource signing has encountered an error in the extended key usage." 2362 case TrustSettingDeny: 2363 return "The trust setting for this policy was set to Deny." 2364 case InvalidSubjectName: 2365 return "An invalid certificate subject name was encountered." 2366 case UnknownQualifiedCertStatement: 2367 return "An unknown qualified certificate statement was encountered." 2368 case MobileMeRequestQueued: 2369 return "The MobileMe request will be sent during the next connection." 2370 case MobileMeRequestRedirected: 2371 return "The MobileMe request was redirected." 2372 case MobileMeServerError: 2373 return "A MobileMe server error occurred." 2374 case MobileMeServerNotAvailable: 2375 return "The MobileMe server is not available." 2376 case MobileMeServerAlreadyExists: 2377 return "The MobileMe server reported that the item already exists." 2378 case MobileMeServerServiceErr: 2379 return "A MobileMe service error has occurred." 2380 case MobileMeRequestAlreadyPending: 2381 return "A MobileMe request is already pending." 2382 case MobileMeNoRequestPending: 2383 return "MobileMe has no request pending." 2384 case MobileMeCSRVerifyFailure: 2385 return "A MobileMe CSR verification failure has occurred." 2386 case MobileMeFailedConsistencyCheck: 2387 return "MobileMe has found a failed consistency check." 2388 case NotInitialized: 2389 return "A function was called without initializing CSSM." 2390 case InvalidHandleUsage: 2391 return "The CSSM handle does not match with the service type." 2392 case PVCReferentNotFound: 2393 return "A reference to the calling module was not found in the list of authorized callers." 2394 case FunctionIntegrityFail: 2395 return "A function address was not within the verified module." 2396 case InternalError: 2397 return "An internal error has occurred." 2398 case MemoryError: 2399 return "A memory error has occurred." 2400 case InvalidData: 2401 return "Invalid data was encountered." 2402 case MDSError: 2403 return "A Module Directory Service error has occurred." 2404 case InvalidPointer: 2405 return "An invalid pointer was encountered." 2406 case SelfCheckFailed: 2407 return "Self-check has failed." 2408 case FunctionFailed: 2409 return "A function has failed." 2410 case ModuleManifestVerifyFailed: 2411 return "A module manifest verification failure has occurred." 2412 case InvalidGUID: 2413 return "An invalid GUID was encountered." 2414 case InvalidHandle: 2415 return "An invalid handle was encountered." 2416 case InvalidDBList: 2417 return "An invalid DB list was encountered." 2418 case InvalidPassthroughID: 2419 return "An invalid passthrough ID was encountered." 2420 case InvalidNetworkAddress: 2421 return "An invalid network address was encountered." 2422 case CRLAlreadySigned: 2423 return "The certificate revocation list is already signed." 2424 case InvalidNumberOfFields: 2425 return "An invalid number of fields were encountered." 2426 case VerificationFailure: 2427 return "A verification failure occurred." 2428 case UnknownTag: 2429 return "An unknown tag was encountered." 2430 case InvalidSignature: 2431 return "An invalid signature was encountered." 2432 case InvalidName: 2433 return "An invalid name was encountered." 2434 case InvalidCertificateRef: 2435 return "An invalid certificate reference was encountered." 2436 case InvalidCertificateGroup: 2437 return "An invalid certificate group was encountered." 2438 case TagNotFound: 2439 return "The specified tag was not found." 2440 case InvalidQuery: 2441 return "The specified query was not valid." 2442 case InvalidValue: 2443 return "An invalid value was detected." 2444 case CallbackFailed: 2445 return "A callback has failed." 2446 case ACLDeleteFailed: 2447 return "An ACL delete operation has failed." 2448 case ACLReplaceFailed: 2449 return "An ACL replace operation has failed." 2450 case ACLAddFailed: 2451 return "An ACL add operation has failed." 2452 case ACLChangeFailed: 2453 return "An ACL change operation has failed." 2454 case InvalidAccessCredentials: 2455 return "Invalid access credentials were encountered." 2456 case InvalidRecord: 2457 return "An invalid record was encountered." 2458 case InvalidACL: 2459 return "An invalid ACL was encountered." 2460 case InvalidSampleValue: 2461 return "An invalid sample value was encountered." 2462 case IncompatibleVersion: 2463 return "An incompatible version was encountered." 2464 case PrivilegeNotGranted: 2465 return "The privilege was not granted." 2466 case InvalidScope: 2467 return "An invalid scope was encountered." 2468 case PVCAlreadyConfigured: 2469 return "The PVC is already configured." 2470 case InvalidPVC: 2471 return "An invalid PVC was encountered." 2472 case EMMLoadFailed: 2473 return "The EMM load has failed." 2474 case EMMUnloadFailed: 2475 return "The EMM unload has failed." 2476 case AddinLoadFailed: 2477 return "The add-in load operation has failed." 2478 case InvalidKeyRef: 2479 return "An invalid key was encountered." 2480 case InvalidKeyHierarchy: 2481 return "An invalid key hierarchy was encountered." 2482 case AddinUnloadFailed: 2483 return "The add-in unload operation has failed." 2484 case LibraryReferenceNotFound: 2485 return "A library reference was not found." 2486 case InvalidAddinFunctionTable: 2487 return "An invalid add-in function table was encountered." 2488 case InvalidServiceMask: 2489 return "An invalid service mask was encountered." 2490 case ModuleNotLoaded: 2491 return "A module was not loaded." 2492 case InvalidSubServiceID: 2493 return "An invalid subservice ID was encountered." 2494 case AttributeNotInContext: 2495 return "An attribute was not in the context." 2496 case ModuleManagerInitializeFailed: 2497 return "A module failed to initialize." 2498 case ModuleManagerNotFound: 2499 return "A module was not found." 2500 case EventNotificationCallbackNotFound: 2501 return "An event notification callback was not found." 2502 case InputLengthError: 2503 return "An input length error was encountered." 2504 case OutputLengthError: 2505 return "An output length error was encountered." 2506 case PrivilegeNotSupported: 2507 return "The privilege is not supported." 2508 case DeviceError: 2509 return "A device error was encountered." 2510 case AttachHandleBusy: 2511 return "The CSP handle was busy." 2512 case NotLoggedIn: 2513 return "You are not logged in." 2514 case AlgorithmMismatch: 2515 return "An algorithm mismatch was encountered." 2516 case KeyUsageIncorrect: 2517 return "The key usage is incorrect." 2518 case KeyBlobTypeIncorrect: 2519 return "The key blob type is incorrect." 2520 case KeyHeaderInconsistent: 2521 return "The key header is inconsistent." 2522 case UnsupportedKeyFormat: 2523 return "The key header format is not supported." 2524 case UnsupportedKeySize: 2525 return "The key size is not supported." 2526 case InvalidKeyUsageMask: 2527 return "The key usage mask is not valid." 2528 case UnsupportedKeyUsageMask: 2529 return "The key usage mask is not supported." 2530 case InvalidKeyAttributeMask: 2531 return "The key attribute mask is not valid." 2532 case UnsupportedKeyAttributeMask: 2533 return "The key attribute mask is not supported." 2534 case InvalidKeyLabel: 2535 return "The key label is not valid." 2536 case UnsupportedKeyLabel: 2537 return "The key label is not supported." 2538 case InvalidKeyFormat: 2539 return "The key format is not valid." 2540 case UnsupportedVectorOfBuffers: 2541 return "The vector of buffers is not supported." 2542 case InvalidInputVector: 2543 return "The input vector is not valid." 2544 case InvalidOutputVector: 2545 return "The output vector is not valid." 2546 case InvalidContext: 2547 return "An invalid context was encountered." 2548 case InvalidAlgorithm: 2549 return "An invalid algorithm was encountered." 2550 case InvalidAttributeKey: 2551 return "A key attribute was not valid." 2552 case MissingAttributeKey: 2553 return "A key attribute was missing." 2554 case InvalidAttributeInitVector: 2555 return "An init vector attribute was not valid." 2556 case MissingAttributeInitVector: 2557 return "An init vector attribute was missing." 2558 case InvalidAttributeSalt: 2559 return "A salt attribute was not valid." 2560 case MissingAttributeSalt: 2561 return "A salt attribute was missing." 2562 case InvalidAttributePadding: 2563 return "A padding attribute was not valid." 2564 case MissingAttributePadding: 2565 return "A padding attribute was missing." 2566 case InvalidAttributeRandom: 2567 return "A random number attribute was not valid." 2568 case MissingAttributeRandom: 2569 return "A random number attribute was missing." 2570 case InvalidAttributeSeed: 2571 return "A seed attribute was not valid." 2572 case MissingAttributeSeed: 2573 return "A seed attribute was missing." 2574 case InvalidAttributePassphrase: 2575 return "A passphrase attribute was not valid." 2576 case MissingAttributePassphrase: 2577 return "A passphrase attribute was missing." 2578 case InvalidAttributeKeyLength: 2579 return "A key length attribute was not valid." 2580 case MissingAttributeKeyLength: 2581 return "A key length attribute was missing." 2582 case InvalidAttributeBlockSize: 2583 return "A block size attribute was not valid." 2584 case MissingAttributeBlockSize: 2585 return "A block size attribute was missing." 2586 case InvalidAttributeOutputSize: 2587 return "An output size attribute was not valid." 2588 case MissingAttributeOutputSize: 2589 return "An output size attribute was missing." 2590 case InvalidAttributeRounds: 2591 return "The number of rounds attribute was not valid." 2592 case MissingAttributeRounds: 2593 return "The number of rounds attribute was missing." 2594 case InvalidAlgorithmParms: 2595 return "An algorithm parameters attribute was not valid." 2596 case MissingAlgorithmParms: 2597 return "An algorithm parameters attribute was missing." 2598 case InvalidAttributeLabel: 2599 return "A label attribute was not valid." 2600 case MissingAttributeLabel: 2601 return "A label attribute was missing." 2602 case InvalidAttributeKeyType: 2603 return "A key type attribute was not valid." 2604 case MissingAttributeKeyType: 2605 return "A key type attribute was missing." 2606 case InvalidAttributeMode: 2607 return "A mode attribute was not valid." 2608 case MissingAttributeMode: 2609 return "A mode attribute was missing." 2610 case InvalidAttributeEffectiveBits: 2611 return "An effective bits attribute was not valid." 2612 case MissingAttributeEffectiveBits: 2613 return "An effective bits attribute was missing." 2614 case InvalidAttributeStartDate: 2615 return "A start date attribute was not valid." 2616 case MissingAttributeStartDate: 2617 return "A start date attribute was missing." 2618 case InvalidAttributeEndDate: 2619 return "An end date attribute was not valid." 2620 case MissingAttributeEndDate: 2621 return "An end date attribute was missing." 2622 case InvalidAttributeVersion: 2623 return "A version attribute was not valid." 2624 case MissingAttributeVersion: 2625 return "A version attribute was missing." 2626 case InvalidAttributePrime: 2627 return "A prime attribute was not valid." 2628 case MissingAttributePrime: 2629 return "A prime attribute was missing." 2630 case InvalidAttributeBase: 2631 return "A base attribute was not valid." 2632 case MissingAttributeBase: 2633 return "A base attribute was missing." 2634 case InvalidAttributeSubprime: 2635 return "A subprime attribute was not valid." 2636 case MissingAttributeSubprime: 2637 return "A subprime attribute was missing." 2638 case InvalidAttributeIterationCount: 2639 return "An iteration count attribute was not valid." 2640 case MissingAttributeIterationCount: 2641 return "An iteration count attribute was missing." 2642 case InvalidAttributeDLDBHandle: 2643 return "A database handle attribute was not valid." 2644 case MissingAttributeDLDBHandle: 2645 return "A database handle attribute was missing." 2646 case InvalidAttributeAccessCredentials: 2647 return "An access credentials attribute was not valid." 2648 case MissingAttributeAccessCredentials: 2649 return "An access credentials attribute was missing." 2650 case InvalidAttributePublicKeyFormat: 2651 return "A public key format attribute was not valid." 2652 case MissingAttributePublicKeyFormat: 2653 return "A public key format attribute was missing." 2654 case InvalidAttributePrivateKeyFormat: 2655 return "A private key format attribute was not valid." 2656 case MissingAttributePrivateKeyFormat: 2657 return "A private key format attribute was missing." 2658 case InvalidAttributeSymmetricKeyFormat: 2659 return "A symmetric key format attribute was not valid." 2660 case MissingAttributeSymmetricKeyFormat: 2661 return "A symmetric key format attribute was missing." 2662 case InvalidAttributeWrappedKeyFormat: 2663 return "A wrapped key format attribute was not valid." 2664 case MissingAttributeWrappedKeyFormat: 2665 return "A wrapped key format attribute was missing." 2666 case StagedOperationInProgress: 2667 return "A staged operation is in progress." 2668 case StagedOperationNotStarted: 2669 return "A staged operation was not started." 2670 case VerifyFailed: 2671 return "A cryptographic verification failure has occurred." 2672 case QuerySizeUnknown: 2673 return "The query size is unknown." 2674 case BlockSizeMismatch: 2675 return "A block size mismatch occurred." 2676 case PublicKeyInconsistent: 2677 return "The public key was inconsistent." 2678 case DeviceVerifyFailed: 2679 return "A device verification failure has occurred." 2680 case InvalidLoginName: 2681 return "An invalid login name was detected." 2682 case AlreadyLoggedIn: 2683 return "The user is already logged in." 2684 case InvalidDigestAlgorithm: 2685 return "An invalid digest algorithm was detected." 2686 case InvalidCRLGroup: 2687 return "An invalid CRL group was detected." 2688 case CertificateCannotOperate: 2689 return "The certificate cannot operate." 2690 case CertificateExpired: 2691 return "An expired certificate was detected." 2692 case CertificateNotValidYet: 2693 return "The certificate is not yet valid." 2694 case CertificateRevoked: 2695 return "The certificate was revoked." 2696 case CertificateSuspended: 2697 return "The certificate was suspended." 2698 case InsufficientCredentials: 2699 return "Insufficient credentials were detected." 2700 case InvalidAction: 2701 return "The action was not valid." 2702 case InvalidAuthority: 2703 return "The authority was not valid." 2704 case VerifyActionFailed: 2705 return "A verify action has failed." 2706 case InvalidCertAuthority: 2707 return "The certificate authority was not valid." 2708 case InvaldCRLAuthority: 2709 return "The CRL authority was not valid." 2710 case InvalidCRLEncoding: 2711 return "The CRL encoding was not valid." 2712 case InvalidCRLType: 2713 return "The CRL type was not valid." 2714 case InvalidCRL: 2715 return "The CRL was not valid." 2716 case InvalidFormType: 2717 return "The form type was not valid." 2718 case InvalidID: 2719 return "The ID was not valid." 2720 case InvalidIdentifier: 2721 return "The identifier was not valid." 2722 case InvalidIndex: 2723 return "The index was not valid." 2724 case InvalidPolicyIdentifiers: 2725 return "The policy identifiers are not valid." 2726 case InvalidTimeString: 2727 return "The time specified was not valid." 2728 case InvalidReason: 2729 return "The trust policy reason was not valid." 2730 case InvalidRequestInputs: 2731 return "The request inputs are not valid." 2732 case InvalidResponseVector: 2733 return "The response vector was not valid." 2734 case InvalidStopOnPolicy: 2735 return "The stop-on policy was not valid." 2736 case InvalidTuple: 2737 return "The tuple was not valid." 2738 case MultipleValuesUnsupported: 2739 return "Multiple values are not supported." 2740 case NotTrusted: 2741 return "The trust policy was not trusted." 2742 case NoDefaultAuthority: 2743 return "No default authority was detected." 2744 case RejectedForm: 2745 return "The trust policy had a rejected form." 2746 case RequestLost: 2747 return "The request was lost." 2748 case RequestRejected: 2749 return "The request was rejected." 2750 case UnsupportedAddressType: 2751 return "The address type is not supported." 2752 case UnsupportedService: 2753 return "The service is not supported." 2754 case InvalidTupleGroup: 2755 return "The tuple group was not valid." 2756 case InvalidBaseACLs: 2757 return "The base ACLs are not valid." 2758 case InvalidTupleCredendtials: 2759 return "The tuple credentials are not valid." 2760 case InvalidEncoding: 2761 return "The encoding was not valid." 2762 case InvalidValidityPeriod: 2763 return "The validity period was not valid." 2764 case InvalidRequestor: 2765 return "The requestor was not valid." 2766 case RequestDescriptor: 2767 return "The request descriptor was not valid." 2768 case InvalidBundleInfo: 2769 return "The bundle information was not valid." 2770 case InvalidCRLIndex: 2771 return "The CRL index was not valid." 2772 case NoFieldValues: 2773 return "No field values were detected." 2774 case UnsupportedFieldFormat: 2775 return "The field format is not supported." 2776 case UnsupportedIndexInfo: 2777 return "The index information is not supported." 2778 case UnsupportedLocality: 2779 return "The locality is not supported." 2780 case UnsupportedNumAttributes: 2781 return "The number of attributes is not supported." 2782 case UnsupportedNumIndexes: 2783 return "The number of indexes is not supported." 2784 case UnsupportedNumRecordTypes: 2785 return "The number of record types is not supported." 2786 case FieldSpecifiedMultiple: 2787 return "Too many fields were specified." 2788 case IncompatibleFieldFormat: 2789 return "The field format was incompatible." 2790 case InvalidParsingModule: 2791 return "The parsing module was not valid." 2792 case DatabaseLocked: 2793 return "The database is locked." 2794 case DatastoreIsOpen: 2795 return "The data store is open." 2796 case MissingValue: 2797 return "A missing value was detected." 2798 case UnsupportedQueryLimits: 2799 return "The query limits are not supported." 2800 case UnsupportedNumSelectionPreds: 2801 return "The number of selection predicates is not supported." 2802 case UnsupportedOperator: 2803 return "The operator is not supported." 2804 case InvalidDBLocation: 2805 return "The database location is not valid." 2806 case InvalidAccessRequest: 2807 return "The access request is not valid." 2808 case InvalidIndexInfo: 2809 return "The index information is not valid." 2810 case InvalidNewOwner: 2811 return "The new owner is not valid." 2812 case InvalidModifyMode: 2813 return "The modify mode is not valid." 2814 case MissingRequiredExtension: 2815 return "A required certificate extension is missing." 2816 case ExtendedKeyUsageNotCritical: 2817 return "The extended key usage extension was not marked critical." 2818 case TimestampMissing: 2819 return "A timestamp was expected but was not found." 2820 case TimestampInvalid: 2821 return "The timestamp was not valid." 2822 case TimestampNotTrusted: 2823 return "The timestamp was not trusted." 2824 case TimestampServiceNotAvailable: 2825 return "The timestamp service is not available." 2826 case TimestampBadAlg: 2827 return "An unrecognized or unsupported Algorithm Identifier in timestamp." 2828 case TimestampBadRequest: 2829 return "The timestamp transaction is not permitted or supported." 2830 case TimestampBadDataFormat: 2831 return "The timestamp data submitted has the wrong format." 2832 case TimestampTimeNotAvailable: 2833 return "The time source for the Timestamp Authority is not available." 2834 case TimestampUnacceptedPolicy: 2835 return "The requested policy is not supported by the Timestamp Authority." 2836 case TimestampUnacceptedExtension: 2837 return "The requested extension is not supported by the Timestamp Authority." 2838 case TimestampAddInfoNotAvailable: 2839 return "The additional information requested is not available." 2840 case TimestampSystemFailure: 2841 return "The timestamp request cannot be handled due to system failure." 2842 case SigningTimeMissing: 2843 return "A signing time was expected but was not found." 2844 case TimestampRejection: 2845 return "A timestamp transaction was rejected." 2846 case TimestampWaiting: 2847 return "A timestamp transaction is waiting." 2848 case TimestampRevocationWarning: 2849 return "A timestamp authority revocation warning was issued." 2850 case TimestampRevocationNotification: 2851 return "A timestamp authority revocation notification was issued." 2852 case UnexpectedError: 2853 return "Unexpected error has occurred." 2854 } 2855 } 2856 } 2857