SQLCipher Swift Package provides developers a quick and easy way to add industry leading secure encryption to Apple projects which use SQLite databases.
The SQLCipher Swift package is maintained by the developers of SQLCipher so there are several benefits to using it as a Swift Package author:
Because of these benefits, use of the SQLCipher Swift Package is the recommended way for Apple-focused libraries to integrate a dependency on SQLCipher. This document will cover:
dependencies: [
.package(url: "https://github.com/sqlcipher/SQLCipher.swift.git", from: "4.10.0")
]
SQLITE_HAS_CODEC
cSettings to your target which has a dependency on SQLCipher.swift
Package
.target(
name: "TargetName",
dependencies: [.product(name: "SQLCipher", package: "SQLCipher.swift")],
cSettings: [
.define("SQLITE_HAS_CODEC", to: nil)
]
)
Import the SQLCipher module and remove any import SQLite3
import SQLCipher
This will allow consumers to programatically set the key used to encrypt the database. Please see the SQLCipher API for Setting the key
This will allow consumers to programatically get the current SQLCipher version used and confirm that SQLCipher is properly loaded. Please see the SQLCipher API for cipher_version
To support package consumers using SQLCipher Commercial products, add a mechanism to set a license code and get the cipher_fips_status.
Please see a full list of the SQLCipher API.
The SQLCipher.swift Swift Package platforms:
Please review the SQLCipher.swift Package details in the SQLCipher.swift GitHub Repository for additional information and license requirements.
As the official SQLCipher.swift Swift Package, we will be updating it with every new SQLCipher release.
SQLCipher release announcements with release notes are available on the SQLCipher discussion forum
SQLCipher major version include breaking changes which aren't backwards compatible with previous versions of SQLCipher. Use caution and test your packages when updating to the next major version. Consider implementing or exposing a mechanism to migrate between major versions using the cipher_migrate SQLCipher API convenienct function.
We throughly test the SQLCipher.swift Swift Package prior to every release. If you experience any bugs or issues with integration, please reach out to us at support@zetetic.net
In addition to the open source version of SQLCipher.swift Swift Package, we sell Commercial and Enterprise packages. This helps support our ongoing work on SQLCipher.
We've designed our commercial and enterprise packages to be drop-in replacements for Consumers who use Third Party Packages with dependencies on SQLCipher.swift community Swift Package