acquire static method
Implementation
static NSEncryptionLease acquire(String path) {
final existing = _leases[path];
if (existing != null) {
existing.refcount++;
return existing.lease;
}
final lease = NSEncryptionLease._(
NativeCallable<ns_database_encrypt_fnFunction>.isolateLocal(
_nativeEncrypt,
exceptionalReturn: false,
),
NativeCallable<ns_database_decrypt_fnFunction>.isolateLocal(
_nativeDecrypt,
exceptionalReturn: false,
),
);
_leases[path] = _LeaseEntry(lease);
return lease;
}