kishikawakatsumi / KeychainAccess

Simple Swift wrapper for Keychain that works on iOS, watchOS, tvOS and macOS.
MIT License
7.95k stars 789 forks source link

Swift 4.2 to 5.0 upgrade #532

Open kristohear opened 2 years ago

kristohear commented 2 years ago

Hi,

We used KeychainAccess to store our encryption key in keychain. We encountered bug when upgrading our application Swift version from 4.2 to 5.0 the key dissapeared from keychain.

        let keychain = Keychain(service: serviceId)

        var key = Data(count: 64)
            _ = key.withUnsafeMutableBytes { bytes in
                SecRandomCopyBytes(kSecRandomDefault, 64, bytes)
            }
        try? keychain.set(key, key: keyId)
DmitriyTerekhin commented 2 years ago

The same!